diff options
author | Руслан Ижбулатов <lrn1986@gmail.com> | 2017-01-26 17:44:01 +0000 |
---|---|---|
committer | Руслан Ижбулатов <lrn1986@gmail.com> | 2017-12-02 10:38:24 +0000 |
commit | 27ed9fb11d0597dc489d1af4ccb834b4371db440 (patch) | |
tree | b17ffd574e1fba2970322428cc7037cf58566d0a /gdk/win32 | |
parent | 58ba4d6a3e0bda764ad7ae9aeede39627ec6deb1 (diff) | |
download | gtk+-27ed9fb11d0597dc489d1af4ccb834b4371db440.tar.gz |
GDK W32: Different maximized window position for non-CSD windows
It seems that WM interprets the same MINMAXINFO contents differently
depending on which styles the window has. Play along.
https://bugzilla.gnome.org/show_bug.cgi?id=765161
Diffstat (limited to 'gdk/win32')
-rw-r--r-- | gdk/win32/gdkevents-win32.c | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/gdk/win32/gdkevents-win32.c b/gdk/win32/gdkevents-win32.c index 614fa689d6..1cba4c4fd9 100644 --- a/gdk/win32/gdkevents-win32.c +++ b/gdk/win32/gdkevents-win32.c @@ -2242,8 +2242,25 @@ _gdk_win32_window_fill_min_max_info (GdkWindow *window, * window will actually end up. * "0" here is the top-left corner of the primary monitor. */ - mmi->ptMaxPosition.x = 0 + (nearest_info.rcWork.left - nearest_info.rcMonitor.left); - mmi->ptMaxPosition.y = 0 + (nearest_info.rcWork.top - nearest_info.rcMonitor.top); + /* An investigation into bug 765161 turned up a weird Windows WM behaviour + * where it would interpret "0:0" as "top-left of the workea" (accounting for a taskbar + * possibly being along the left/top edge of the screen) when window has styles + * (i.e. not CSD), and interpret the same "0:0" as "top-left of the screen" (not + * accounting for a taskbar) when window has no styles (i.e. a CSD window). + * This doesn't seem to be documented anywhere. + * The following code uses a simple CSD/non-CSD test, but it could be that + * this behaviour hinges on just one particular window style. + * Finding exactly which style that could be is not very useful for GTK, however. + */ + mmi->ptMaxPosition.x = 0; + mmi->ptMaxPosition.y = 0; + + if (_gdk_win32_window_lacks_wm_decorations (window)) + { + mmi->ptMaxPosition.x += (nearest_info.rcWork.left - nearest_info.rcMonitor.left); + mmi->ptMaxPosition.y += (nearest_info.rcWork.top - nearest_info.rcMonitor.top); + } + mmi->ptMaxSize.x = nearest_info.rcWork.right - nearest_info.rcWork.left; mmi->ptMaxSize.y = nearest_info.rcWork.bottom - nearest_info.rcWork.top; } |