AltSnap icon indicating copy to clipboard operation
AltSnap copied to clipboard

Fix crash caused by window with size 0

Open gzaugg opened this issue 1 year ago • 0 comments

This pull request addresses an issue where the "Focus Window" action in AltSnap causes the program to crash when a window with a size of 0 is present. Although the configuration dialog remains functional, windows can no longer be dragged. This PR introduces a fix for the problem.

I was unable to find a way to deliberately recreate the window with size 0. However, I encountered the same issue on two different PCs running Windows 11 (one of them a fresh installation). Below are the properties of the problematic window:

---------------------------
Debug Info
---------------------------
Window Rect: (top, left, bottom, right): 720, 1280, 720, 1280
Process name: Unknown
IsWindowVisible: TRUE
IsWindowCloaked: FALSE
EXSTYLE & WS_EX_NOACTIVATE: TRUE
EXSTYLE & WS_EX_TOOLWINDOW: FALSE
STYLE & WS_CAPTION: TRUE
EXSTYLE & WS_EX_APPWINDOW: FALSE
BorderlessFlag: FALSE
MenuShowEmptyLabelWin: FALSE
Window title: 'Setup'
Blacklisted (Bottommost): FALSE

=> IsAltTabAble Result: TRUE

My assumption is that this issue may be related to a system update window in Win11 (and maybe other versions as well), though this has not been confirmed.

gzaugg avatar Oct 15 '24 16:10 gzaugg