From 4c3b17d492a787e84ec823fdd8d472c82536c641 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20Preu=C3=9F?= Date: Mon, 22 Nov 2021 16:01:45 +0100 Subject: [PATCH] fix: focus lone window with move focus shortcut Before, when no window was focused, focusing a window with keyboard shortcuts would only work if there were two or more windows visible. It would also only consider tiled windows at all. Now, any window, floating or tiled, is considered when no window was focused previously. --- src/kwinscript/engine/index.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/kwinscript/engine/index.ts b/src/kwinscript/engine/index.ts index cd905296..0b964cb2 100644 --- a/src/kwinscript/engine/index.ts +++ b/src/kwinscript/engine/index.ts @@ -458,12 +458,12 @@ export class EngineImpl implements Engine { public focusDir(dir: Direction): void { const window = this.controller.currentWindow; - /* if no current window, select the first tile. */ + /* if no current window, select the first window. */ if (window === null) { - const tiles = this.windows.visibleTiledWindowsOn( + const tiles = this.windows.visibleWindowsOn( this.controller.currentSurface ); - if (tiles.length > 1) { + if (tiles.length > 0) { this.controller.currentWindow = tiles[0]; } return;