maximization test: correct expectations for tiled window
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
{
|
||||
const workspaceMock = initMocks();
|
||||
const world = new World(getDefaultConfig());
|
||||
const config = getDefaultConfig();
|
||||
const world = new World(config);
|
||||
|
||||
const kwinClient = new MockKwinClient(
|
||||
1,
|
||||
@@ -14,18 +15,22 @@
|
||||
assert(clientManager.hasClient(kwinClient));
|
||||
})
|
||||
|
||||
const columnLeftX = screenWidth/2 - 300/2;
|
||||
const columnTopY = config.gapsOuterTop;
|
||||
const columnHeight = screenHeight - config.gapsOuterTop - config.gapsOuterBottom;
|
||||
|
||||
kwinClient.fullScreen = true;
|
||||
assertRect(kwinClient.frameGeometry, 0, 0, screenWidth, screenHeight);
|
||||
|
||||
kwinClient.fullScreen = false;
|
||||
assertRect(kwinClient.frameGeometry, 10, 20, 300, 200);
|
||||
assertRect(kwinClient.frameGeometry, columnLeftX, columnTopY, 300, columnHeight);
|
||||
|
||||
kwinClient.setMaximize(true, true);
|
||||
assertRect(kwinClient.frameGeometry, 0, 0, screenWidth, screenHeight);
|
||||
|
||||
kwinClient.setMaximize(true, false);
|
||||
assertRect(kwinClient.frameGeometry, 10, 0, 300, screenHeight);
|
||||
assertRect(kwinClient.frameGeometry, columnLeftX, 0, 300, screenHeight);
|
||||
|
||||
kwinClient.setMaximize(false, false);
|
||||
assertRect(kwinClient.frameGeometry, 10, 20, 300, 200);
|
||||
assertRect(kwinClient.frameGeometry, columnLeftX, columnTopY, 300, columnHeight);
|
||||
}
|
||||
|
||||
@@ -7,12 +7,12 @@ class MockWorkspace {
|
||||
public windows = [];
|
||||
public cursorPos = new MockQmlPoint(0, 0);
|
||||
|
||||
public activeWindow: any;
|
||||
private _activeWindow: KwinClient|null = null;
|
||||
|
||||
public readonly currentDesktopChanged = new MockQSignal<[]>();
|
||||
public readonly windowAdded = new MockQSignal<[MockKwinClient]>();
|
||||
public readonly windowRemoved = new MockQSignal<[MockKwinClient]>();
|
||||
public readonly windowActivated = new MockQSignal<[MockKwinClient|null]>();
|
||||
public readonly windowAdded = new MockQSignal<[KwinClient]>();
|
||||
public readonly windowRemoved = new MockQSignal<[KwinClient]>();
|
||||
public readonly windowActivated = new MockQSignal<[KwinClient|null]>();
|
||||
public readonly screensChanged = new MockQSignal<[]>();
|
||||
public readonly activitiesChanged = new MockQSignal<[]>();
|
||||
public readonly desktopsChanged = new MockQSignal<[]>();
|
||||
@@ -25,5 +25,15 @@ class MockWorkspace {
|
||||
|
||||
public createWindow(kwinClient: MockKwinClient) {
|
||||
this.windowAdded.fire(kwinClient);
|
||||
this.activeWindow = kwinClient;
|
||||
}
|
||||
|
||||
public get activeWindow() {
|
||||
return this._activeWindow;
|
||||
}
|
||||
|
||||
public set activeWindow(activeWindow: KwinClient|null) {
|
||||
this._activeWindow = activeWindow;
|
||||
this.windowActivated.fire(activeWindow);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user