[gtk/wip.win32.fixes: 14/15] Revert "GDK-Win32: Some cleanups"




commit d55366ac58423b595c9682e28af7263aa562e703
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Fri Jul 2 10:29:04 2021 +0800

    Revert "GDK-Win32: Some cleanups"
    
    This reverts commit 81de39ed8bd22cc708ff2c59298286d1b6fa2409.

 gdk/win32/gdkevents-win32.c  | 4 +++-
 gdk/win32/gdkprivate-win32.h | 2 +-
 gdk/win32/gdksurface-win32.c | 3 ++-
 gdk/win32/gdksurface-win32.h | 1 +
 4 files changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/gdk/win32/gdkevents-win32.c b/gdk/win32/gdkevents-win32.c
index c50f91785c..2be0aac319 100644
--- a/gdk/win32/gdkevents-win32.c
+++ b/gdk/win32/gdkevents-win32.c
@@ -1246,7 +1246,7 @@ synthesize_crossing_events (GdkDisplay                 *display,
  * Returns FALSE if configure events should be inhibited,
  * TRUE otherwise.
  */
-void
+gboolean
 _gdk_win32_get_window_rect (GdkSurface *window,
                             RECT      *rect)
 {
@@ -1273,6 +1273,8 @@ _gdk_win32_get_window_rect (GdkSurface *window,
   rect->top = point.y;
   rect->right = point.x + client_rect.right - client_rect.left;
   rect->bottom = point.y + client_rect.bottom - client_rect.top;
+
+  return !impl->inhibit_configure;
 }
 
 cairo_region_t *
diff --git a/gdk/win32/gdkprivate-win32.h b/gdk/win32/gdkprivate-win32.h
index de117ccb29..d37866bcf3 100644
--- a/gdk/win32/gdkprivate-win32.h
+++ b/gdk/win32/gdkprivate-win32.h
@@ -414,7 +414,7 @@ guint32 _gdk_win32_keymap_get_decimal_mark (GdkWin32Keymap *keymap);
 void     _gdk_win32_surface_handle_aerosnap      (GdkSurface            *window,
                                                   GdkWin32AeroSnapCombo combo);
 
-void     _gdk_win32_get_window_rect             (GdkSurface  *window,
+gboolean _gdk_win32_get_window_rect             (GdkSurface  *window,
                                                  RECT       *rect);
 void     _gdk_win32_do_emit_configure_event     (GdkSurface  *window,
                                                  RECT        rect);
diff --git a/gdk/win32/gdksurface-win32.c b/gdk/win32/gdksurface-win32.c
index daf51d688a..9f387d0357 100644
--- a/gdk/win32/gdksurface-win32.c
+++ b/gdk/win32/gdksurface-win32.c
@@ -3836,7 +3836,8 @@ gdk_win32_surface_do_move_resize_drag (GdkSurface *window,
   impl = GDK_WIN32_SURFACE (window);
   context = &impl->drag_move_resize_context;
 
-  _gdk_win32_get_window_rect (window, &rect);
+  if (!_gdk_win32_get_window_rect (window, &rect))
+    return;
 
   new_rect = context->start_rect;
   diffx = (x - context->start_root_x) * impl->surface_scale;
diff --git a/gdk/win32/gdksurface-win32.h b/gdk/win32/gdksurface-win32.h
index 7288314ec1..2e29427a4f 100644
--- a/gdk/win32/gdksurface-win32.h
+++ b/gdk/win32/gdksurface-win32.h
@@ -275,6 +275,7 @@ struct _GdkWin32Surface
    * We don't actually set shadow to 0, we just set this bit.
    */
   guint zero_shadow : 1;
+  guint inhibit_configure : 1;
 
   /* If TRUE, the @temp_styles is set to the styles that were temporarily
    * added to this window.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]