From d927c292cc29f78736d63d2df7367dccc16e3d59 Mon Sep 17 00:00:00 2001 From: Nir Lichtman Date: Mon, 29 Apr 2024 22:44:03 +0300 Subject: [PATCH] Go back to tiling if alt+j/k pressed in focus mode --- tiling.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tiling.c b/tiling.c index cce6247..36c5447 100644 --- a/tiling.c +++ b/tiling.c @@ -54,7 +54,7 @@ void tileWindows() { numOfManagedWindows = 0; - if (focusedWindow == 0) { + if (focusedWindow == NULL) { EnumChildWindows(GetDesktopWindow(), EnumChildProc, 0); } else { managed[numOfManagedWindows] = focusedWindow; @@ -70,8 +70,8 @@ void tileWindows() void toggleFocusedWindow(HWND hwnd) { - if (focusedWindow != 0) { - focusedWindow = 0; + if (focusedWindow != NULL) { + focusedWindow = NULL; } else { focusedWindow = hwnd; } @@ -81,6 +81,10 @@ void toggleFocusedWindow(HWND hwnd) void focusNextWindow(bool goBack) { + if (focusedWindow != NULL) { + toggleFocusedWindow(NULL); + } + currentFocusedWindowIndex += goBack ? -1 : 1; if (currentFocusedWindowIndex < 0) {