Skip to content

Commit

Permalink
fix: focus lone window with move focus shortcut
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Daxtorim authored and Mikhail Zolotukhin committed Nov 25, 2021
1 parent 3d9c874 commit 4c3b17d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/kwinscript/engine/index.ts
Expand Up @@ -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;
Expand Down

0 comments on commit 4c3b17d

Please sign in to comment.