From 80df4f3b1cfcc9111722f970eab6370c5fddf9e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A0=D1=83=D1=81=D0=BB=D0=B0=D0=BD=20=D0=98=D0=B6=D0=B1?= =?UTF-8?q?=D1=83=D0=BB=D0=B0=D1=82=D0=BE=D0=B2?= Date: Thu, 26 Mar 2015 17:01:59 +0000 Subject: [PATCH] W32: Only override window miximized position for CSDed windows This fixes an issue with non-CSDed windows being improperly positioned when maximized, which was introduced by the previous commit. https://bugzilla.gnome.org/show_bug.cgi?id=746821 --- gdk/win32/gdkevents-win32.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/gdk/win32/gdkevents-win32.c b/gdk/win32/gdkevents-win32.c index d206efa008..c55cee049e 100644 --- a/gdk/win32/gdkevents-win32.c +++ b/gdk/win32/gdkevents-win32.c @@ -1837,6 +1837,7 @@ gdk_event_translate (MSG *msg, RECT rect, *drag, orig_drag; POINT point; MINMAXINFO *mmi; + LONG style; HWND hwnd; HCURSOR hcursor; BYTE key_state[256]; @@ -3044,6 +3045,8 @@ gdk_event_translate (MSG *msg, mmi->ptMaxPosition.x, mmi->ptMaxPosition.y, mmi->ptMaxSize.x, mmi->ptMaxSize.y)); + style = GetWindowLong (GDK_WINDOW_HWND (window), GWL_STYLE); + if (impl->hint_flags & GDK_HINT_MIN_SIZE) { rect.left = rect.top = 0; @@ -3072,7 +3075,10 @@ gdk_event_translate (MSG *msg, mmi->ptMaxTrackSize.x = maxw > 0 && maxw < G_MAXSHORT ? maxw : G_MAXSHORT; mmi->ptMaxTrackSize.y = maxh > 0 && maxh < G_MAXSHORT ? maxh : G_MAXSHORT; } - else + /* Assume that these styles are incompatible with CSD, + * so there's no reason for us to override the defaults. + */ + else if ((style & (WS_BORDER | WS_THICKFRAME)) == 0) { HMONITOR winmon; MONITORINFO moninfo;