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.
This commit is contained in:
Fabian Preuß 2021-11-22 16:01:45 +01:00 committed by Mikhail Zolotukhin
parent 3d9c874439
commit 4c3b17d492

View File

@ -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;