[gtk+/gtk-2-24-quartz] win32: Ignore client requested window move/size during SIZEMOVE
- From: John Ralls <jralls src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/gtk-2-24-quartz] win32: Ignore client requested window move/size during SIZEMOVE
- Date: Wed, 23 Nov 2011 22:59:17 +0000 (UTC)
commit 9ad17b51fb8e3f82515bdc4c46788f1a34cfe1ae
Author: Alexander Larsson <alexl redhat com>
Date: Tue Oct 25 16:13:47 2011 +0200
win32: Ignore client requested window move/size during SIZEMOVE
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 | 13 +++++++++++--
gdk/win32/gdkglobals-win32.c | 1 +
gdk/win32/gdkprivate-win32.h | 2 ++
gdk/win32/gdkwindow-win32.c | 5 +++++
4 files changed, 19 insertions(+), 2 deletions(-)
---
diff --git a/gdk/win32/gdkevents-win32.c b/gdk/win32/gdkevents-win32.c
index 436ad4c..e786ece 100644
--- a/gdk/win32/gdkevents-win32.c
+++ b/gdk/win32/gdkevents-win32.c
@@ -2853,13 +2853,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:
@@ -2867,7 +2873,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:
diff --git a/gdk/win32/gdkglobals-win32.c b/gdk/win32/gdkglobals-win32.c
index f9b2c02..1a876d0 100644
--- a/gdk/win32/gdkglobals-win32.c
+++ b/gdk/win32/gdkglobals-win32.c
@@ -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;
diff --git a/gdk/win32/gdkprivate-win32.h b/gdk/win32/gdkprivate-win32.h
index 1f961d2..a480cb7 100644
--- a/gdk/win32/gdkprivate-win32.h
+++ b/gdk/win32/gdkprivate-win32.h
@@ -467,6 +467,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;
diff --git a/gdk/win32/gdkwindow-win32.c b/gdk/win32/gdkwindow-win32.c
index a0a1ae9..fc3adb5 100644
--- a/gdk/win32/gdkwindow-win32.c
+++ b/gdk/win32/gdkwindow-win32.c
@@ -1310,6 +1310,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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]