diff --git a/src/lib/rules/WindowRuleEnforcer.ts b/src/lib/rules/WindowRuleEnforcer.ts index c519182..b8e662a 100644 --- a/src/lib/rules/WindowRuleEnforcer.ts +++ b/src/lib/rules/WindowRuleEnforcer.ts @@ -11,14 +11,12 @@ class WindowRuleEnforcer { } public shouldTile(kwinClient: KwinClient) { - return Clients.canTileNow(kwinClient) && ( - this.preferTiling.matches(kwinClient) || ( - kwinClient.normalWindow && - !kwinClient.transient && - kwinClient.managed && - kwinClient.pid > -1 && - !this.preferFloating.matches(kwinClient) - ) + return this.preferTiling.matches(kwinClient) || ( + kwinClient.normalWindow && + !kwinClient.transient && + kwinClient.managed && + kwinClient.pid > -1 && + !this.preferFloating.matches(kwinClient) ); } @@ -30,7 +28,7 @@ class WindowRuleEnforcer { const enforcer = this; const manager = new SignalManager(); manager.connect(kwinClient.captionChanged, () => { - const shouldTile = enforcer.shouldTile(kwinClient); + const shouldTile = Clients.canTileNow(kwinClient) && enforcer.shouldTile(kwinClient); world.do((clientManager, desktopManager) => { const desktop = desktopManager.getDesktopForClient(kwinClient); if (shouldTile && desktop !== undefined) { diff --git a/src/lib/world/ClientManager.ts b/src/lib/world/ClientManager.ts index 3410d93..84d5303 100644 --- a/src/lib/world/ClientManager.ts +++ b/src/lib/world/ClientManager.ts @@ -32,7 +32,7 @@ class ClientManager { let constructState: (client: ClientWrapper) => ClientState.State; if (kwinClient.dock) { constructState = () => new ClientState.Docked(this.world, kwinClient); - } else if (this.windowRuleEnforcer.shouldTile(kwinClient) && desktop !== undefined) { + } else if (Clients.canTileNow(kwinClient) && this.windowRuleEnforcer.shouldTile(kwinClient) && desktop !== undefined) { constructState = (client: ClientWrapper) => new ClientState.Tiled(this.world, client, desktop.grid); } else { constructState = (client: ClientWrapper) => new ClientState.Floating(this.world, client, this.config, false);