Skip to content

Commit

Permalink
Do not tile popups
Browse files Browse the repository at this point in the history
  • Loading branch information
nir9 committed Feb 4, 2024
1 parent 5a3ac67 commit 0510b84
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
8 changes: 7 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
14 changes: 12 additions & 2 deletions tiling.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 0510b84

Please sign in to comment.