]> Pileus Git - ~andy/gtk/commitdiff
win32: Ignore client requested window move/size during SIZEMOVE
authorAlexander Larsson <alexl@redhat.com>
Tue, 25 Oct 2011 14:13:47 +0000 (16:13 +0200)
committerAlexander Larsson <alexl@redhat.com>
Thu, 10 Nov 2011 16:41:00 +0000 (17:41 +0100)
This will just be fighting the user like in e.g.
https://bugzilla.gnome.org/show_bug.cgi?id=64428

gdk/win32/gdkevents-win32.c
gdk/win32/gdkglobals-win32.c
gdk/win32/gdkprivate-win32.h
gdk/win32/gdkwindow-win32.c

index bc2f8a52040e242d1a9d30652cd6dead0620685d..3777910b06c6f8a3d728f165c2c28eb0d59f3645 100644 (file)
@@ -2660,13 +2660,19 @@ gdk_event_translate (MSG  *msg,
 
     case WM_ENTERSIZEMOVE:
     case WM_ENTERMENULOOP:
+      if (msg->message == WM_ENTERSIZEMOVE)
+       _modal_move_resize_window = msg->hwnd;
+
       _gdk_win32_begin_modal_call ();
       break;
 
     case WM_EXITSIZEMOVE:
     case WM_EXITMENULOOP:
       if (_modal_operation_in_progress)
-       _gdk_win32_end_modal_call ();
+       {
+         _modal_move_resize_window = NULL;
+         _gdk_win32_end_modal_call ();
+       }
       break;
 
     case WM_CAPTURECHANGED:
@@ -2674,7 +2680,10 @@ gdk_event_translate (MSG  *msg,
         select move/size in the menu and then click somewhere without
         moving/resizing. We work around this using WM_CAPTURECHANGED. */
       if (_modal_operation_in_progress)
-       _gdk_win32_end_modal_call ();
+       {
+         _modal_move_resize_window = NULL;
+         _gdk_win32_end_modal_call ();
+       }
       break;
 
     case WM_WINDOWPOSCHANGING:
index f9b2c024a523343b7091baa24c3b409290316303..1a876d0ec2a46273b7e0783feeab6e5679e03c7b 100644 (file)
@@ -79,6 +79,7 @@ gint            _gdk_input_ignore_wintab = FALSE;
 gint             _gdk_max_colors = 0;
 
 gboolean         _modal_operation_in_progress = FALSE;
+HWND              _modal_move_resize_window = NULL;
 gboolean         _ignore_destroy_clipboard = FALSE;
 
 HGLOBAL           _delayed_rendering_data = NULL;
index 0bfcd3fd9b60ca1f012551948caf34ccfc16d628..9ecfc6e3f9f66d7f599426d84a097c82fc5da702 100644 (file)
@@ -343,6 +343,8 @@ extern gint          _gdk_max_colors;
 /* TRUE while a modal sizing, moving, or dnd operation is in progress */
 extern gboolean                _modal_operation_in_progress;
 
+extern HWND            _modal_move_resize_window;
+
 /* TRUE when we are emptying the clipboard ourselves */
 extern gboolean                _ignore_destroy_clipboard;
 
index 449a286d648fb4b29c7f16d4187620d61e4a0afc..b08d74b570beb8b254d21ce7731ac7a98acc6f2c 100644 (file)
@@ -1201,6 +1201,11 @@ gdk_win32_window_move_resize (GdkWindow *window,
                              gint       width,
                              gint       height)
 {
+  /* We ignore changes to the window being moved or resized by the 
+     user, as we don't want to fight the user */
+  if (GDK_WINDOW_HWND (window) == _modal_move_resize_window)
+    return;
+
   if (with_move && (width < 0 && height < 0))
     {
       gdk_win32_window_move (window, x, y);