From 0510b846a4dd25b2cc29b291e3445bfa99f6aa67 Mon Sep 17 00:00:00 2001 From: Nir Lichtman Date: Mon, 5 Feb 2024 01:46:07 +0200 Subject: [PATCH] Do not tile popups --- Makefile | 8 +++++++- tiling.c | 14 ++++++++++++-- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 16a14db..72c3e82 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ LD = link EXEC = lightwm.exe DLL = lightwm_dll.dll -all: clean $(DLL) $(EXEC) +all: clean_old $(DLL) $(EXEC) $(EXEC): wm.c $(CC) wm.c tiling.c error.c user32.lib /link /out:$(EXEC) @@ -15,5 +15,11 @@ $(DLL): wm_dll.obj wm_dll.obj: wm_dll.c $(CC) /c wm_dll.c +# Temporary for a couple of weeks +clean_old: + if exist wm.exe ( del wm.exe ) + if exist wm_dll.dll ( del wm_dll.dll ) + echo Old cleanup done + clean: del *.obj *.exe *.dll *.lib *.exp diff --git a/tiling.c b/tiling.c index 5db98c1..ce7ccf1 100644 --- a/tiling.c +++ b/tiling.c @@ -6,12 +6,22 @@ HWND managed[256]; int currentManagedIndex = 0; BOOL CALLBACK EnumChildProc(HWND hwnd, LPARAM lparam) { + if (currentManagedIndex > 255) { + return FALSE; + } + if (!IsWindowVisible(hwnd) || IsHungAppWindow(hwnd)) { return TRUE; } - if (currentManagedIndex > 255) { - return FALSE; + WINDOWINFO winInfo; + winInfo.cbSize = sizeof(WINDOWINFO); + if (!GetWindowInfo(hwnd, &winInfo)) { + return TRUE; + } + + if (winInfo.dwStyle & WS_POPUP) { + return TRUE; } if (GetWindowTextLengthW(hwnd) == 0) {