I am trying to make a borderless window in Qt5.6.0, with aero-snap functionality. Everything works, except when I maximize the window : it is too big.
My screen resolution is 2560x1440
, so the window should be sized 2560x1400
(40 Pixels for the Taskbar), but in the WM_SIZE
message, the new size is 2576x1416
.
So the window is exactly 8 pixels too big in every direction.
This also means that the window is not aligned in the top-left corner, it is exactly 8 pixels off-screen in both directions.
I can't find a solution for this problem, everything I have tried doesn't work and causes bugs.
The only thing that fixes this is to remove the WS_CAPTION
and WS_THICKFRAME
styles, but then I lose the areo snap functionality.
I somehow have to tell Qt or DWM to make the window 16 pixels smaller and move it 8 pixels right, and bottom. Does anybody have an idea on how to do that?