https://bugs.winehq.org/show_bug.cgi?id=48490
Bug ID: 48490 Summary: Restored minimized windows have wrong height Product: Wine Version: 5.0-rc6 Hardware: x86 OS: Linux Status: NEW Keywords: regression Severity: normal Priority: P2 Component: winex11.drv Assignee: wine-bugs@winehq.org Reporter: gabrielopcode@gmail.com CC: z.figura12@gmail.com Regression SHA1: 118f333ac233c69399a01424a6218d130983d644 Distribution: ---
The commit 118f333ac233c69399a01424a6218d130983d644 exposed this bug. Specifically, this change:
- new_window_rect->bottom = new_window_rect->top + GetSystemMetrics(SM_CYICON); + new_window_rect->bottom = new_window_rect->top + GetSystemMetrics(SM_CYMINIMIZED);
The bug is actually in winex11.drv's X11DRV_X_to_window_rect. To reproduce this, managed + decorated windows must be set, and then:
1) Launch wine notepad. 2) Minimize it. 3) Click on notepad on the DE's taskbar to restore it.
When it is restored, it will be "off" by a few pixels at the bottom (smaller), having a small gap. In my case, it is 4 pixels off.
This is due to the fact that SM_CYMINIMIZED is 24, while the decoration's title bar is 26 pixels, and border is 1 pixel. Since the border is on both the top and bottom, the total extra "decoration" height is 28 pixels.
However, the referenced commit changes the size of the window to 24, which is smaller than the decoration. That's perfectly fine by itself, since it's what happens on Windows in this case. The problem is that the real decoration size information is lost in this way for the window, even though X11DRV_X_to_window_rect uses it and assumes it is correct. It has to be recomputed.
The previous constant (SM_CYICON), didn't trigger this bug because it was larger than the decoration in my case (32 pixels vs 28), which was probably just luck.
I'll send a fix soon to hopefully fix this properly.
https://bugs.winehq.org/show_bug.cgi?id=48490
Gabriel Ivăncescu gabrielopcode@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution|--- |FIXED Fixed by SHA1| |fff364274774fe51bdc8a0aee22 | |369aac161dcb7
--- Comment #1 from Gabriel Ivăncescu gabrielopcode@gmail.com --- Fixed by fff364274774fe51bdc8a0aee22369aac161dcb7.
https://bugs.winehq.org/show_bug.cgi?id=48490
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #2 from Alexandre Julliard julliard@winehq.org --- Closing bugs fixed in 5.9.
https://bugs.winehq.org/show_bug.cgi?id=48490
--- Comment #3 from Michael Stefaniuc mstefani@winehq.org --- Removing the 5.0.x milestone from bug fixes included in 5.0.2.