[Bug 48490] New: Restored minimized windows have wrong height

WineHQ Bugzilla wine-bugs at winehq.org
Mon Jan 20 06:29:23 CST 2020


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 at winehq.org
          Reporter: gabrielopcode at gmail.com
                CC: z.figura12 at 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.

-- 
Do not reply to this email, post in Bugzilla using the
above URL to reply.
You are receiving this mail because:
You are watching all bug changes.



More information about the wine-bugs mailing list