Skip to content

Commit

Permalink
Go back to tiling if alt+j/k pressed in focus mode
Browse files Browse the repository at this point in the history
  • Loading branch information
nir9 committed Apr 29, 2024
1 parent 47e87be commit d927c29
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions tiling.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ void tileWindows()
{
numOfManagedWindows = 0;

if (focusedWindow == 0) {
if (focusedWindow == NULL) {
EnumChildWindows(GetDesktopWindow(), EnumChildProc, 0);
} else {
managed[numOfManagedWindows] = focusedWindow;
Expand All @@ -70,8 +70,8 @@ void tileWindows()

void toggleFocusedWindow(HWND hwnd)
{
if (focusedWindow != 0) {
focusedWindow = 0;
if (focusedWindow != NULL) {
focusedWindow = NULL;
} else {
focusedWindow = hwnd;
}
Expand All @@ -81,6 +81,10 @@ void toggleFocusedWindow(HWND hwnd)

void focusNextWindow(bool goBack)
{
if (focusedWindow != NULL) {
toggleFocusedWindow(NULL);
}

currentFocusedWindowIndex += goBack ? -1 : 1;

if (currentFocusedWindowIndex < 0) {
Expand Down

0 comments on commit d927c29

Please sign in to comment.