summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorРуслан Ижбулатов <lrn1986@gmail.com>2015-03-26 17:01:59 +0000
committerРуслан Ижбулатов <lrn1986@gmail.com>2015-03-26 17:08:32 +0000
commit282ce477c5f6c052c276438cf2c0b0464c755abb (patch)
tree173564aef86eb65d4de61d38c5e6368b9bf8fd72
parent6125baa67037a178fa2233061a16ca2a5ccd5cf1 (diff)
downloadgtk+-282ce477c5f6c052c276438cf2c0b0464c755abb.tar.gz
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
-rw-r--r--gdk/win32/gdkevents-win32.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/gdk/win32/gdkevents-win32.c b/gdk/win32/gdkevents-win32.c
index d9e4de5120..e8ffa7cbed 100644
--- a/gdk/win32/gdkevents-win32.c
+++ b/gdk/win32/gdkevents-win32.c
@@ -1838,6 +1838,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];
@@ -3046,6 +3047,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;
@@ -3074,7 +3077,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;