[Bug 45099] New: SetWindowPlacement doesn' t restore the normal position correctly

wine-bugs at winehq.org wine-bugs at winehq.org
Mon Apr 30 11:36:28 CDT 2018


https://bugs.winehq.org/show_bug.cgi?id=45099

            Bug ID: 45099
           Summary: SetWindowPlacement doesn't restore the normal position
                    correctly
           Product: Wine
           Version: 3.6
          Hardware: x86
                OS: Linux
            Status: UNCONFIRMED
          Severity: minor
          Priority: P2
         Component: user32
          Assignee: wine-bugs at winehq.org
          Reporter: vz-wine at zeitlins.org
      Distribution: ---

Consider an application which calls GetWindowPlacement() on its main window to
store its geometry on exit and SetWindowPlacement() on startup to restore the
previously stored values. If the window of such application is maximized on
exit, then the window is correctly restored to the maximized state during the
next run, but restoring this window, i.e. returning it to the normal,
unmaximized state, doesn't restore it to the previous position (although it
does restore its size).

Here are some excerpts from the logs I see with WINEDEBUG=win for the last
execution:

0009:trace:win:WINPOS_SetPlacement 0x10050: setting min 0,0 max 0,55 normal
(3440,1910)-(3840,2160) flags 6 ajusted to min 0,0 max 0,55 normal
(3440,1910)-(3840,2160)
0009:trace:win:SetWindowPos hwnd 0x10050, after (nil), 3440,1910 (400x250),
flags 00000014
...
0009:trace:win:WINPOS_MinMaximize 0x10050 3
0009:trace:win:GetWindowPlacement 0x10050: returning min -1,-1 max 0,55 normal
(3440,1910)-(3840,2160)
0009:trace:win:GetWindowRect hwnd 0x10050 (3440,1910)-(3840,2160)
... I restore the window here ...
0009:trace:win:WINPOS_MinMaximize 0x10050 9
0009:trace:win:GetWindowPlacement 0x10050: returning min -1,-1 max 0,55 normal
(3440,1910)-(3840,2160)
... almost immediately after ...
0009:trace:win:USER_SetWindowPos        status flags = 1807
0009:trace:win:GetWindowRect hwnd 0x10064 (3445,2119)-(3835,2155)
0009:trace:win:GetWindowRect hwnd 0x10064 (3445,2119)-(3835,2155)
0009:trace:win:GetWindowRect hwnd 0x10064 (3445,2119)-(3835,2155)
0009:trace:win:GetWindowRect hwnd 0x10050 (3440,1910)-(3840,2160)
0009:trace:win:SetWindowPos hwnd 0x10050, after (nil), 115,87 (400x250), flags
00000015
... when closing the program ...
0009:trace:win:GetWindowPlacement 0x10050: returning min -1,-1 max 0,55 normal
(115,87)-(515,337)

I.e. SetWindowPlacement() is passed the correct position (3440,1910
corresponding to the lower right corner), and even restoring it still uses the
same correct position, but then the window is somehow moved to the wrong
position (115,87) for some reason which I don't understand.

This is just a minor irritant, of course, but I'd still like to open this bug
just in case it's also simple to fix.

-- 
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