fix keepBelow and keepAbove properties for windows that start in full-screen mode (issue 79)
This commit is contained in:
@@ -216,10 +216,18 @@ namespace ClientState {
|
||||
if (config.skipSwitcher) {
|
||||
client.kwinClient.skipSwitcher = true;
|
||||
}
|
||||
if (config.tiledKeepBelow) {
|
||||
client.kwinClient.keepBelow = true;
|
||||
|
||||
if (client.kwinClient.fullScreen) {
|
||||
if (config.maximizedKeepAbove) {
|
||||
client.kwinClient.keepAbove = true;
|
||||
}
|
||||
} else {
|
||||
if (config.tiledKeepBelow) {
|
||||
client.kwinClient.keepBelow = true;
|
||||
}
|
||||
client.kwinClient.keepAbove = false;
|
||||
}
|
||||
client.kwinClient.keepAbove = false;
|
||||
|
||||
if (client.kwinClient.tile !== null) {
|
||||
client.setMaximize(false, true); // disable quick tile mode
|
||||
}
|
||||
|
||||
326
src/tests/flows/maximizationFloatingAbove.ts
Normal file
326
src/tests/flows/maximizationFloatingAbove.ts
Normal file
@@ -0,0 +1,326 @@
|
||||
tests.register("Maximization (floating above)", 100, () => {
|
||||
const config = getDefaultConfig();
|
||||
config.tiledKeepBelow = false;
|
||||
config.floatingKeepAbove = true;
|
||||
const { qtMock, workspaceMock, world } = init(config);
|
||||
|
||||
const [kwinClient] = workspaceMock.createClientsWithWidths(300);
|
||||
world.do((clientManager, desktopManager) => {
|
||||
Assert.assert(clientManager.hasClient(kwinClient));
|
||||
});
|
||||
|
||||
const columnLeftX = tilingArea.left + tilingArea.width/2 - 300/2;
|
||||
const columnTopY = tilingArea.top;
|
||||
const columnHeight = tilingArea.height;
|
||||
Assert.assert(!kwinClient.fullScreen);
|
||||
Assert.assert(!kwinClient.keepBelow);
|
||||
Assert.assert(!kwinClient.keepAbove);
|
||||
Assert.rect(kwinClient.frameGeometry, columnLeftX, columnTopY, 300, columnHeight);
|
||||
|
||||
kwinClient.fullScreen = true;
|
||||
Assert.assert(kwinClient.fullScreen);
|
||||
Assert.assert(!kwinClient.keepBelow);
|
||||
Assert.assert(kwinClient.keepAbove);
|
||||
Assert.equalRects(kwinClient.frameGeometry, screen);
|
||||
|
||||
kwinClient.fullScreen = false;
|
||||
Assert.assert(!kwinClient.fullScreen);
|
||||
Assert.assert(!kwinClient.keepBelow);
|
||||
Assert.assert(!kwinClient.keepAbove);
|
||||
Assert.rect(kwinClient.frameGeometry, columnLeftX, columnTopY, 300, columnHeight);
|
||||
|
||||
kwinClient.setMaximize(true, true);
|
||||
Assert.assert(!kwinClient.fullScreen);
|
||||
Assert.assert(!kwinClient.keepBelow);
|
||||
Assert.assert(kwinClient.keepAbove);
|
||||
Assert.equalRects(kwinClient.frameGeometry, screen);
|
||||
|
||||
kwinClient.setMaximize(true, false);
|
||||
Assert.assert(!kwinClient.fullScreen);
|
||||
Assert.assert(!kwinClient.keepBelow);
|
||||
Assert.assert(kwinClient.keepAbove);
|
||||
Assert.rect(kwinClient.frameGeometry, columnLeftX, 0, 300, screen.height);
|
||||
|
||||
kwinClient.setMaximize(false, false);
|
||||
Assert.assert(!kwinClient.fullScreen);
|
||||
Assert.assert(!kwinClient.keepBelow);
|
||||
Assert.assert(!kwinClient.keepAbove);
|
||||
Assert.rect(kwinClient.frameGeometry, columnLeftX, columnTopY, 300, columnHeight);
|
||||
});
|
||||
|
||||
tests.register("Maximize with transient (floating above)", 100, () => {
|
||||
const config = getDefaultConfig();
|
||||
config.tiledKeepBelow = false;
|
||||
config.floatingKeepAbove = true;
|
||||
const { qtMock, workspaceMock, world } = init(config);
|
||||
|
||||
const parent = new MockKwinClient(new MockQmlRect(10, 20, 300, 200));
|
||||
const child = new MockKwinClient(new MockQmlRect(14, 24, 50, 50), parent);
|
||||
|
||||
workspaceMock.createWindows(parent);
|
||||
world.do((clientManager, desktopManager) => {
|
||||
Assert.assert(clientManager.hasClient(parent));
|
||||
});
|
||||
|
||||
runOneOf(
|
||||
() => parent.fullScreen = true,
|
||||
() => parent.setMaximize(true, true),
|
||||
);
|
||||
Assert.assert(!parent.keepBelow);
|
||||
Assert.assert(parent.keepAbove);
|
||||
Assert.equalRects(parent.frameGeometry, screen);
|
||||
|
||||
workspaceMock.createWindows(child);
|
||||
world.do((clientManager, desktopManager) => {
|
||||
Assert.assert(clientManager.hasClient(child));
|
||||
});
|
||||
Assert.assert(!child.fullScreen);
|
||||
Assert.assert(!child.keepBelow);
|
||||
Assert.assert(child.keepAbove);
|
||||
Assert.rect(child.frameGeometry, 14, 24, 50, 50);
|
||||
Assert.assert(!parent.keepBelow);
|
||||
Assert.assert(parent.keepAbove);
|
||||
Assert.equalRects(parent.frameGeometry, screen);
|
||||
});
|
||||
|
||||
tests.register("Re-maximize disabled (floating above)", 100, () => {
|
||||
const config = getDefaultConfig();
|
||||
config.tiledKeepBelow = false;
|
||||
config.floatingKeepAbove = true;
|
||||
config.reMaximize = false;
|
||||
const { qtMock, workspaceMock, world } = init(config);
|
||||
|
||||
const [client1, client2] = workspaceMock.createClientsWithWidths(300, 400);
|
||||
world.do((clientManager, desktopManager) => {
|
||||
Assert.assert(clientManager.hasClient(client1));
|
||||
Assert.assert(clientManager.hasClient(client2));
|
||||
});
|
||||
|
||||
const columnsWidth = 300 + 400 + config.gapsInnerHorizontal;
|
||||
const column1LeftX = tilingArea.left + tilingArea.width/2 - columnsWidth/2;
|
||||
const column2LeftX = column1LeftX + 300 + config.gapsInnerHorizontal;
|
||||
const columnTopY = tilingArea.top;
|
||||
const columnHeight = tilingArea.height;
|
||||
Assert.assert(!client1.fullScreen);
|
||||
Assert.assert(!client1.keepBelow);
|
||||
Assert.assert(!client1.keepAbove);
|
||||
Assert.rect(client1.frameGeometry, column1LeftX, columnTopY, 300, columnHeight);
|
||||
Assert.assert(!client2.fullScreen);
|
||||
Assert.assert(!client2.keepBelow);
|
||||
Assert.assert(!client2.keepAbove);
|
||||
Assert.rect(client2.frameGeometry, column2LeftX, columnTopY, 400, columnHeight);
|
||||
|
||||
runOneOf(
|
||||
() => client2.fullScreen = true,
|
||||
() => client2.setMaximize(true, true),
|
||||
);
|
||||
Assert.assert(!client1.fullScreen);
|
||||
Assert.assert(!client1.keepBelow);
|
||||
Assert.assert(!client1.keepAbove);
|
||||
Assert.rect(client1.frameGeometry, column1LeftX, columnTopY, 300, columnHeight);
|
||||
Assert.assert(!client2.keepBelow);
|
||||
Assert.assert(client2.keepAbove);
|
||||
Assert.equalRects(client2.frameGeometry, screen);
|
||||
|
||||
runOneOf(
|
||||
() => workspaceMock.activeWindow = client1,
|
||||
() => qtMock.fireShortcut("karousel-focus-1"),
|
||||
() => qtMock.fireShortcut("karousel-focus-left"),
|
||||
() => qtMock.fireShortcut("karousel-focus-start"),
|
||||
);
|
||||
Assert.assert(!client1.fullScreen);
|
||||
Assert.assert(!client1.keepBelow);
|
||||
Assert.assert(!client1.keepAbove);
|
||||
Assert.rect(client1.frameGeometry, column1LeftX, columnTopY, 300, columnHeight);
|
||||
Assert.assert(!client2.fullScreen);
|
||||
Assert.assert(!client2.keepBelow);
|
||||
Assert.assert(!client2.keepAbove);
|
||||
Assert.rect(client2.frameGeometry, column2LeftX, columnTopY, 400, columnHeight);
|
||||
|
||||
runOneOf(
|
||||
() => workspaceMock.activeWindow = client2,
|
||||
() => qtMock.fireShortcut("karousel-focus-2"),
|
||||
() => qtMock.fireShortcut("karousel-focus-right"),
|
||||
() => qtMock.fireShortcut("karousel-focus-end"),
|
||||
);
|
||||
Assert.assert(!client1.fullScreen);
|
||||
Assert.assert(!client1.keepBelow);
|
||||
Assert.assert(!client1.keepAbove);
|
||||
Assert.rect(client1.frameGeometry, column1LeftX, columnTopY, 300, columnHeight);
|
||||
Assert.assert(!client2.fullScreen);
|
||||
Assert.assert(!client2.keepBelow);
|
||||
Assert.assert(!client2.keepAbove);
|
||||
Assert.rect(client2.frameGeometry, column2LeftX, columnTopY, 400, columnHeight);
|
||||
});
|
||||
|
||||
tests.register("Re-maximize enabled (floating above)", 100, () => {
|
||||
const config = getDefaultConfig();
|
||||
config.tiledKeepBelow = false;
|
||||
config.floatingKeepAbove = true;
|
||||
config.reMaximize = true;
|
||||
const { qtMock, workspaceMock, world } = init(config);
|
||||
|
||||
const [client1, client2] = workspaceMock.createClientsWithWidths(300, 400);
|
||||
world.do((clientManager, desktopManager) => {
|
||||
Assert.assert(clientManager.hasClient(client1));
|
||||
Assert.assert(clientManager.hasClient(client2));
|
||||
});
|
||||
|
||||
const columnsWidth = 300 + 400 + config.gapsInnerHorizontal;
|
||||
const column1LeftX = tilingArea.left + tilingArea.width/2 - columnsWidth/2;
|
||||
const column2LeftX = column1LeftX + 300 + config.gapsInnerHorizontal;
|
||||
const columnTopY = tilingArea.top;
|
||||
const columnHeight = tilingArea.height;
|
||||
Assert.assert(!client1.fullScreen);
|
||||
Assert.assert(!client1.keepBelow);
|
||||
Assert.assert(!client1.keepAbove);
|
||||
Assert.rect(client1.frameGeometry, column1LeftX, columnTopY, 300, columnHeight);
|
||||
Assert.assert(!client2.fullScreen);
|
||||
Assert.assert(!client2.keepBelow);
|
||||
Assert.assert(!client2.keepAbove);
|
||||
Assert.rect(client2.frameGeometry, column2LeftX, columnTopY, 400, columnHeight);
|
||||
|
||||
runOneOf(
|
||||
() => client2.fullScreen = true,
|
||||
() => client2.setMaximize(true, true),
|
||||
);
|
||||
Assert.assert(!client1.fullScreen);
|
||||
Assert.assert(!client1.keepBelow);
|
||||
Assert.assert(!client1.keepAbove);
|
||||
Assert.rect(client1.frameGeometry, column1LeftX, columnTopY, 300, columnHeight);
|
||||
Assert.assert(!client2.keepBelow);
|
||||
Assert.assert(client2.keepAbove);
|
||||
Assert.equalRects(client2.frameGeometry, screen);
|
||||
|
||||
runOneOf(
|
||||
() => workspaceMock.activeWindow = client1,
|
||||
() => qtMock.fireShortcut("karousel-focus-1"),
|
||||
() => qtMock.fireShortcut("karousel-focus-left"),
|
||||
() => qtMock.fireShortcut("karousel-focus-start"),
|
||||
);
|
||||
Assert.assert(!client1.fullScreen);
|
||||
Assert.assert(!client1.keepBelow);
|
||||
Assert.assert(!client1.keepAbove);
|
||||
Assert.rect(client1.frameGeometry, column1LeftX, columnTopY, 300, columnHeight);
|
||||
Assert.assert(!client2.fullScreen);
|
||||
Assert.assert(!client2.keepBelow);
|
||||
Assert.assert(!client2.keepAbove);
|
||||
Assert.rect(client2.frameGeometry, column2LeftX, columnTopY, 400, columnHeight);
|
||||
|
||||
runOneOf(
|
||||
() => workspaceMock.activeWindow = client2,
|
||||
() => qtMock.fireShortcut("karousel-focus-2"),
|
||||
() => qtMock.fireShortcut("karousel-focus-right"),
|
||||
() => qtMock.fireShortcut("karousel-focus-end"),
|
||||
);
|
||||
Assert.assert(!client1.fullScreen);
|
||||
Assert.assert(!client1.keepBelow);
|
||||
Assert.assert(!client1.keepAbove);
|
||||
Assert.rect(client1.frameGeometry, column1LeftX, columnTopY, 300, columnHeight);
|
||||
Assert.assert(!client2.keepBelow);
|
||||
Assert.assert(client2.keepAbove);
|
||||
Assert.equalRects(client2.frameGeometry, screen);
|
||||
});
|
||||
|
||||
tests.register("Start full-screen (floating above)", 100, () => {
|
||||
const config = getDefaultConfig();
|
||||
config.tiledKeepBelow = false;
|
||||
config.floatingKeepAbove = true;
|
||||
config.reMaximize = true;
|
||||
const { qtMock, workspaceMock, world } = init(config);
|
||||
|
||||
const [windowedClient] = workspaceMock.createClientsWithWidths(300);
|
||||
const fullScreenClient = new MockKwinClient(new MockQmlRect(0, 0, 400, 200));
|
||||
fullScreenClient.resourceClass = "full-screen-app";
|
||||
fullScreenClient.fullScreen = true;
|
||||
workspaceMock.createWindows(fullScreenClient);
|
||||
|
||||
world.do((clientManager, desktopManager) => {
|
||||
Assert.assert(clientManager.hasClient(windowedClient));
|
||||
Assert.assert(clientManager.hasClient(fullScreenClient));
|
||||
});
|
||||
|
||||
Assert.assert(!windowedClient.fullScreen);
|
||||
Assert.assert(!windowedClient.keepBelow);
|
||||
Assert.assert(!windowedClient.keepAbove);
|
||||
Assert.centered(config, tilingArea, windowedClient);
|
||||
Assert.assert(fullScreenClient.fullScreen);
|
||||
Assert.assert(!fullScreenClient.keepBelow);
|
||||
Assert.assert(fullScreenClient.keepAbove);
|
||||
Assert.equalRects(fullScreenClient.frameGeometry, screen);
|
||||
Assert.equal(Workspace.activeWindow, fullScreenClient);
|
||||
|
||||
{
|
||||
qtMock.fireShortcut("karousel-focus-left");
|
||||
const opts = { message: "fullScreenClient is not in the grid, so we can't move focus directionally" };
|
||||
Assert.assert(!windowedClient.fullScreen);
|
||||
Assert.assert(!windowedClient.keepBelow);
|
||||
Assert.assert(!windowedClient.keepAbove);
|
||||
Assert.centered(config, tilingArea, windowedClient);
|
||||
Assert.assert(fullScreenClient.fullScreen);
|
||||
Assert.assert(!fullScreenClient.keepBelow);
|
||||
Assert.assert(fullScreenClient.keepAbove);
|
||||
Assert.equalRects(fullScreenClient.frameGeometry, screen);
|
||||
Assert.equal(Workspace.activeWindow, fullScreenClient, opts);
|
||||
}
|
||||
|
||||
{
|
||||
qtMock.fireShortcut("karousel-focus-1");
|
||||
const opts = { message: "fullScreenClient is not in grid, so it should stay full-screen" };
|
||||
Assert.assert(!windowedClient.fullScreen);
|
||||
Assert.assert(!windowedClient.keepBelow);
|
||||
Assert.assert(!windowedClient.keepAbove);
|
||||
Assert.centered(config, tilingArea, windowedClient);
|
||||
Assert.assert(fullScreenClient.fullScreen);
|
||||
Assert.assert(!fullScreenClient.keepBelow);
|
||||
Assert.assert(fullScreenClient.keepAbove);
|
||||
Assert.equalRects(fullScreenClient.frameGeometry, screen);
|
||||
Assert.equal(Workspace.activeWindow, windowedClient);
|
||||
}
|
||||
});
|
||||
|
||||
tests.register("Start full-screen (force tiling) (floating above)", 100, () => {
|
||||
const config = getDefaultConfig();
|
||||
config.tiledKeepBelow = false;
|
||||
config.floatingKeepAbove = true;
|
||||
config.reMaximize = true;
|
||||
config.windowRules = '[{ "class": "full-screen-app", "tile": true }]';
|
||||
const { qtMock, workspaceMock, world } = init(config);
|
||||
|
||||
const column1Width = 300;
|
||||
const [windowedClient] = workspaceMock.createClientsWithWidths(column1Width);
|
||||
const fullScreenClient = new MockKwinClient(new MockQmlRect(0, 0, 400, 200));
|
||||
fullScreenClient.resourceClass = "full-screen-app";
|
||||
fullScreenClient.fullScreen = true;
|
||||
workspaceMock.createWindows(fullScreenClient);
|
||||
|
||||
world.do((clientManager, desktopManager) => {
|
||||
Assert.assert(clientManager.hasClient(windowedClient));
|
||||
Assert.assert(clientManager.hasClient(fullScreenClient));
|
||||
});
|
||||
Assert.assert(!windowedClient.fullScreen);
|
||||
Assert.assert(!windowedClient.keepBelow);
|
||||
Assert.assert(!windowedClient.keepAbove);
|
||||
Assert.assert(fullScreenClient.fullScreen);
|
||||
Assert.assert(!fullScreenClient.keepBelow);
|
||||
Assert.assert(fullScreenClient.keepAbove);
|
||||
Assert.equalRects(fullScreenClient.frameGeometry, screen);
|
||||
Assert.equal(Workspace.activeWindow, fullScreenClient);
|
||||
|
||||
const column2Width = tilingArea.width;
|
||||
const column1LeftX = tilingArea.left;
|
||||
const column2LeftX = column1LeftX + column1Width + gapH;
|
||||
const columnTopY = tilingArea.top;
|
||||
const columnHeight = tilingArea.height;
|
||||
qtMock.fireShortcut("karousel-focus-left");
|
||||
const opts = { message: "fullScreenClient should be restored from full-screen mode to tiled mode" };
|
||||
Assert.assert(!windowedClient.fullScreen);
|
||||
Assert.assert(!windowedClient.keepBelow);
|
||||
Assert.assert(!windowedClient.keepAbove);
|
||||
Assert.rect(windowedClient.frameGeometry, column1LeftX, columnTopY, column1Width, columnHeight, opts);
|
||||
Assert.assert(!fullScreenClient.fullScreen);
|
||||
Assert.assert(!fullScreenClient.keepBelow);
|
||||
Assert.assert(!fullScreenClient.keepAbove);
|
||||
Assert.rect(fullScreenClient.frameGeometry, column2LeftX, columnTopY, column2Width, columnHeight, opts);
|
||||
Assert.equal(Workspace.activeWindow, windowedClient);
|
||||
});
|
||||
@@ -1,5 +1,7 @@
|
||||
tests.register("Maximization", 100, () => {
|
||||
tests.register("Maximization (tiled below)", 100, () => {
|
||||
const config = getDefaultConfig();
|
||||
config.tiledKeepBelow = true;
|
||||
config.floatingKeepAbove = false;
|
||||
const { qtMock, workspaceMock, world } = init(config);
|
||||
|
||||
const [kwinClient] = workspaceMock.createClientsWithWidths(300);
|
||||
@@ -10,26 +12,46 @@ tests.register("Maximization", 100, () => {
|
||||
const columnLeftX = tilingArea.left + tilingArea.width/2 - 300/2;
|
||||
const columnTopY = tilingArea.top;
|
||||
const columnHeight = tilingArea.height;
|
||||
Assert.assert(!kwinClient.fullScreen);
|
||||
Assert.assert(kwinClient.keepBelow);
|
||||
Assert.assert(!kwinClient.keepAbove);
|
||||
Assert.rect(kwinClient.frameGeometry, columnLeftX, columnTopY, 300, columnHeight);
|
||||
|
||||
kwinClient.fullScreen = true;
|
||||
Assert.assert(kwinClient.fullScreen);
|
||||
Assert.assert(!kwinClient.keepBelow);
|
||||
Assert.assert(!kwinClient.keepAbove);
|
||||
Assert.equalRects(kwinClient.frameGeometry, screen);
|
||||
|
||||
kwinClient.fullScreen = false;
|
||||
Assert.assert(!kwinClient.fullScreen);
|
||||
Assert.assert(kwinClient.keepBelow);
|
||||
Assert.assert(!kwinClient.keepAbove);
|
||||
Assert.rect(kwinClient.frameGeometry, columnLeftX, columnTopY, 300, columnHeight);
|
||||
|
||||
kwinClient.setMaximize(true, true);
|
||||
Assert.assert(!kwinClient.fullScreen);
|
||||
Assert.assert(!kwinClient.keepBelow);
|
||||
Assert.assert(!kwinClient.keepAbove);
|
||||
Assert.equalRects(kwinClient.frameGeometry, screen);
|
||||
|
||||
kwinClient.setMaximize(true, false);
|
||||
Assert.assert(!kwinClient.fullScreen);
|
||||
Assert.assert(!kwinClient.keepBelow);
|
||||
Assert.assert(!kwinClient.keepAbove);
|
||||
Assert.rect(kwinClient.frameGeometry, columnLeftX, 0, 300, screen.height);
|
||||
|
||||
kwinClient.setMaximize(false, false);
|
||||
Assert.assert(!kwinClient.fullScreen);
|
||||
Assert.assert(kwinClient.keepBelow);
|
||||
Assert.assert(!kwinClient.keepAbove);
|
||||
Assert.rect(kwinClient.frameGeometry, columnLeftX, columnTopY, 300, columnHeight);
|
||||
});
|
||||
|
||||
tests.register("Maximize with transient", 100, () => {
|
||||
tests.register("Maximize with transient (tiled below)", 100, () => {
|
||||
const config = getDefaultConfig();
|
||||
config.tiledKeepBelow = true;
|
||||
config.floatingKeepAbove = false;
|
||||
const { qtMock, workspaceMock, world } = init(config);
|
||||
|
||||
const parent = new MockKwinClient(new MockQmlRect(10, 20, 300, 200));
|
||||
@@ -44,18 +66,27 @@ tests.register("Maximize with transient", 100, () => {
|
||||
() => parent.fullScreen = true,
|
||||
() => parent.setMaximize(true, true),
|
||||
);
|
||||
Assert.assert(!parent.keepBelow);
|
||||
Assert.assert(!parent.keepAbove);
|
||||
Assert.equalRects(parent.frameGeometry, screen);
|
||||
|
||||
workspaceMock.createWindows(child);
|
||||
world.do((clientManager, desktopManager) => {
|
||||
Assert.assert(clientManager.hasClient(child));
|
||||
});
|
||||
Assert.assert(!child.fullScreen);
|
||||
Assert.assert(!child.keepBelow);
|
||||
Assert.assert(!child.keepAbove);
|
||||
Assert.rect(child.frameGeometry, 14, 24, 50, 50);
|
||||
Assert.assert(!parent.keepBelow);
|
||||
Assert.assert(!parent.keepAbove);
|
||||
Assert.equalRects(parent.frameGeometry, screen);
|
||||
});
|
||||
|
||||
tests.register("Re-maximize disabled", 100, () => {
|
||||
tests.register("Re-maximize disabled (tiled below)", 100, () => {
|
||||
const config = getDefaultConfig();
|
||||
config.tiledKeepBelow = true;
|
||||
config.floatingKeepAbove = false;
|
||||
config.reMaximize = false;
|
||||
const { qtMock, workspaceMock, world } = init(config);
|
||||
|
||||
@@ -70,14 +101,25 @@ tests.register("Re-maximize disabled", 100, () => {
|
||||
const column2LeftX = column1LeftX + 300 + config.gapsInnerHorizontal;
|
||||
const columnTopY = tilingArea.top;
|
||||
const columnHeight = tilingArea.height;
|
||||
Assert.assert(!client1.fullScreen);
|
||||
Assert.assert(client1.keepBelow);
|
||||
Assert.assert(!client1.keepAbove);
|
||||
Assert.rect(client1.frameGeometry, column1LeftX, columnTopY, 300, columnHeight);
|
||||
Assert.assert(!client2.fullScreen);
|
||||
Assert.assert(client2.keepBelow);
|
||||
Assert.assert(!client2.keepAbove);
|
||||
Assert.rect(client2.frameGeometry, column2LeftX, columnTopY, 400, columnHeight);
|
||||
|
||||
runOneOf(
|
||||
() => client2.fullScreen = true,
|
||||
() => client2.setMaximize(true, true),
|
||||
);
|
||||
Assert.assert(!client1.fullScreen);
|
||||
Assert.assert(client1.keepBelow);
|
||||
Assert.assert(!client1.keepAbove);
|
||||
Assert.rect(client1.frameGeometry, column1LeftX, columnTopY, 300, columnHeight);
|
||||
Assert.assert(!client2.keepBelow);
|
||||
Assert.assert(!client2.keepAbove);
|
||||
Assert.equalRects(client2.frameGeometry, screen);
|
||||
|
||||
runOneOf(
|
||||
@@ -86,7 +128,13 @@ tests.register("Re-maximize disabled", 100, () => {
|
||||
() => qtMock.fireShortcut("karousel-focus-left"),
|
||||
() => qtMock.fireShortcut("karousel-focus-start"),
|
||||
);
|
||||
Assert.assert(!client1.fullScreen);
|
||||
Assert.assert(client1.keepBelow);
|
||||
Assert.assert(!client1.keepAbove);
|
||||
Assert.rect(client1.frameGeometry, column1LeftX, columnTopY, 300, columnHeight);
|
||||
Assert.assert(!client2.fullScreen);
|
||||
Assert.assert(client2.keepBelow);
|
||||
Assert.assert(!client2.keepAbove);
|
||||
Assert.rect(client2.frameGeometry, column2LeftX, columnTopY, 400, columnHeight);
|
||||
|
||||
runOneOf(
|
||||
@@ -95,12 +143,20 @@ tests.register("Re-maximize disabled", 100, () => {
|
||||
() => qtMock.fireShortcut("karousel-focus-right"),
|
||||
() => qtMock.fireShortcut("karousel-focus-end"),
|
||||
);
|
||||
Assert.assert(!client1.fullScreen);
|
||||
Assert.assert(client1.keepBelow);
|
||||
Assert.assert(!client1.keepAbove);
|
||||
Assert.rect(client1.frameGeometry, column1LeftX, columnTopY, 300, columnHeight);
|
||||
Assert.assert(!client2.fullScreen);
|
||||
Assert.assert(client2.keepBelow);
|
||||
Assert.assert(!client2.keepAbove);
|
||||
Assert.rect(client2.frameGeometry, column2LeftX, columnTopY, 400, columnHeight);
|
||||
});
|
||||
|
||||
tests.register("Re-maximize enabled", 100, () => {
|
||||
tests.register("Re-maximize enabled (tiled below)", 100, () => {
|
||||
const config = getDefaultConfig();
|
||||
config.tiledKeepBelow = true;
|
||||
config.floatingKeepAbove = false;
|
||||
config.reMaximize = true;
|
||||
const { qtMock, workspaceMock, world } = init(config);
|
||||
|
||||
@@ -115,14 +171,25 @@ tests.register("Re-maximize enabled", 100, () => {
|
||||
const column2LeftX = column1LeftX + 300 + config.gapsInnerHorizontal;
|
||||
const columnTopY = tilingArea.top;
|
||||
const columnHeight = tilingArea.height;
|
||||
Assert.assert(!client1.fullScreen);
|
||||
Assert.assert(client1.keepBelow);
|
||||
Assert.assert(!client1.keepAbove);
|
||||
Assert.rect(client1.frameGeometry, column1LeftX, columnTopY, 300, columnHeight);
|
||||
Assert.assert(!client2.fullScreen);
|
||||
Assert.assert(client2.keepBelow);
|
||||
Assert.assert(!client2.keepAbove);
|
||||
Assert.rect(client2.frameGeometry, column2LeftX, columnTopY, 400, columnHeight);
|
||||
|
||||
runOneOf(
|
||||
() => client2.fullScreen = true,
|
||||
() => client2.setMaximize(true, true),
|
||||
);
|
||||
Assert.assert(!client1.fullScreen);
|
||||
Assert.assert(client1.keepBelow);
|
||||
Assert.assert(!client1.keepAbove);
|
||||
Assert.rect(client1.frameGeometry, column1LeftX, columnTopY, 300, columnHeight);
|
||||
Assert.assert(!client2.keepBelow);
|
||||
Assert.assert(!client2.keepAbove);
|
||||
Assert.equalRects(client2.frameGeometry, screen);
|
||||
|
||||
runOneOf(
|
||||
@@ -131,7 +198,13 @@ tests.register("Re-maximize enabled", 100, () => {
|
||||
() => qtMock.fireShortcut("karousel-focus-left"),
|
||||
() => qtMock.fireShortcut("karousel-focus-start"),
|
||||
);
|
||||
Assert.assert(!client1.fullScreen);
|
||||
Assert.assert(client1.keepBelow);
|
||||
Assert.assert(!client1.keepAbove);
|
||||
Assert.rect(client1.frameGeometry, column1LeftX, columnTopY, 300, columnHeight);
|
||||
Assert.assert(!client2.fullScreen);
|
||||
Assert.assert(client2.keepBelow);
|
||||
Assert.assert(!client2.keepAbove);
|
||||
Assert.rect(client2.frameGeometry, column2LeftX, columnTopY, 400, columnHeight);
|
||||
|
||||
runOneOf(
|
||||
@@ -140,12 +213,19 @@ tests.register("Re-maximize enabled", 100, () => {
|
||||
() => qtMock.fireShortcut("karousel-focus-right"),
|
||||
() => qtMock.fireShortcut("karousel-focus-end"),
|
||||
);
|
||||
Assert.assert(!client1.fullScreen);
|
||||
Assert.assert(client1.keepBelow);
|
||||
Assert.assert(!client1.keepAbove);
|
||||
Assert.rect(client1.frameGeometry, column1LeftX, columnTopY, 300, columnHeight);
|
||||
Assert.assert(!client2.keepBelow);
|
||||
Assert.assert(!client2.keepAbove);
|
||||
Assert.equalRects(client2.frameGeometry, screen);
|
||||
});
|
||||
|
||||
tests.register("Start full-screen", 100, () => {
|
||||
tests.register("Start full-screen (tiled below)", 100, () => {
|
||||
const config = getDefaultConfig();
|
||||
config.tiledKeepBelow = true;
|
||||
config.floatingKeepAbove = false;
|
||||
config.reMaximize = true;
|
||||
const { qtMock, workspaceMock, world } = init(config);
|
||||
|
||||
@@ -160,29 +240,49 @@ tests.register("Start full-screen", 100, () => {
|
||||
Assert.assert(clientManager.hasClient(fullScreenClient));
|
||||
});
|
||||
|
||||
Assert.assert(!windowedClient.fullScreen);
|
||||
Assert.assert(windowedClient.keepBelow);
|
||||
Assert.assert(!windowedClient.keepAbove);
|
||||
Assert.centered(config, tilingArea, windowedClient);
|
||||
Assert.assert(fullScreenClient.fullScreen);
|
||||
Assert.assert(!fullScreenClient.keepBelow);
|
||||
Assert.assert(!fullScreenClient.keepAbove);
|
||||
Assert.equalRects(fullScreenClient.frameGeometry, screen);
|
||||
Assert.equal(Workspace.activeWindow, fullScreenClient);
|
||||
|
||||
{
|
||||
qtMock.fireShortcut("karousel-focus-left");
|
||||
const opts = { message: "fullScreenClient is not in the grid, so we can't move focus directionally" };
|
||||
Assert.centered(config, tilingArea, windowedClient, opts);
|
||||
Assert.equalRects(fullScreenClient.frameGeometry, screen, opts);
|
||||
Assert.assert(!windowedClient.fullScreen);
|
||||
Assert.assert(windowedClient.keepBelow);
|
||||
Assert.assert(!windowedClient.keepAbove);
|
||||
Assert.centered(config, tilingArea, windowedClient);
|
||||
Assert.assert(fullScreenClient.fullScreen);
|
||||
Assert.assert(!fullScreenClient.keepBelow);
|
||||
Assert.assert(!fullScreenClient.keepAbove);
|
||||
Assert.equalRects(fullScreenClient.frameGeometry, screen);
|
||||
Assert.equal(Workspace.activeWindow, fullScreenClient, opts);
|
||||
}
|
||||
|
||||
{
|
||||
qtMock.fireShortcut("karousel-focus-1");
|
||||
const opts = { message: "fullScreenClient is not in grid, so it should stay full-screen" };
|
||||
Assert.centered(config, tilingArea, windowedClient, opts);
|
||||
Assert.equalRects(fullScreenClient.frameGeometry, screen, opts);
|
||||
Assert.assert(!windowedClient.fullScreen);
|
||||
Assert.assert(windowedClient.keepBelow);
|
||||
Assert.assert(!windowedClient.keepAbove);
|
||||
Assert.centered(config, tilingArea, windowedClient);
|
||||
Assert.assert(fullScreenClient.fullScreen);
|
||||
Assert.assert(!fullScreenClient.keepBelow);
|
||||
Assert.assert(!fullScreenClient.keepAbove);
|
||||
Assert.equalRects(fullScreenClient.frameGeometry, screen);
|
||||
Assert.equal(Workspace.activeWindow, windowedClient);
|
||||
}
|
||||
});
|
||||
|
||||
tests.register("Start full-screen (force tiling)", 100, () => {
|
||||
tests.register("Start full-screen (force tiling) (tiled below)", 100, () => {
|
||||
const config = getDefaultConfig();
|
||||
config.tiledKeepBelow = true;
|
||||
config.floatingKeepAbove = false;
|
||||
config.reMaximize = true;
|
||||
config.windowRules = '[{ "class": "full-screen-app", "tile": true }]';
|
||||
const { qtMock, workspaceMock, world } = init(config);
|
||||
@@ -198,6 +298,12 @@ tests.register("Start full-screen (force tiling)", 100, () => {
|
||||
Assert.assert(clientManager.hasClient(windowedClient));
|
||||
Assert.assert(clientManager.hasClient(fullScreenClient));
|
||||
});
|
||||
Assert.assert(!windowedClient.fullScreen);
|
||||
Assert.assert(windowedClient.keepBelow);
|
||||
Assert.assert(!windowedClient.keepAbove);
|
||||
Assert.assert(fullScreenClient.fullScreen);
|
||||
Assert.assert(!fullScreenClient.keepBelow);
|
||||
Assert.assert(!fullScreenClient.keepAbove);
|
||||
Assert.equalRects(fullScreenClient.frameGeometry, screen);
|
||||
Assert.equal(Workspace.activeWindow, fullScreenClient);
|
||||
|
||||
@@ -208,7 +314,13 @@ tests.register("Start full-screen (force tiling)", 100, () => {
|
||||
const columnHeight = tilingArea.height;
|
||||
qtMock.fireShortcut("karousel-focus-left");
|
||||
const opts = { message: "fullScreenClient should be restored from full-screen mode to tiled mode" };
|
||||
Assert.assert(!windowedClient.fullScreen);
|
||||
Assert.assert(windowedClient.keepBelow);
|
||||
Assert.assert(!windowedClient.keepAbove);
|
||||
Assert.rect(windowedClient.frameGeometry, column1LeftX, columnTopY, column1Width, columnHeight, opts);
|
||||
Assert.assert(!fullScreenClient.fullScreen);
|
||||
Assert.assert(fullScreenClient.keepBelow);
|
||||
Assert.assert(!fullScreenClient.keepAbove);
|
||||
Assert.rect(fullScreenClient.frameGeometry, column2LeftX, columnTopY, column2Width, columnHeight, opts);
|
||||
Assert.equal(Workspace.activeWindow, windowedClient);
|
||||
});
|
||||
Reference in New Issue
Block a user