[gtk+/gtk-2-24] quartz: handle didMove and didResize in the same way



commit 70124c7e46b2d55f6284bf7c4a75532aec137baf
Author: Kristian Rietveld <kris loopnest org>
Date:   Sat Apr 16 18:44:13 2016 +0100

    quartz: handle didMove and didResize in the same way
    
    This fixes bugs with applications that try to allocate large windows,
    but are not allocated the full requested size. See for example
    GNOME Bugzilla #765120.

 gdk/quartz/GdkQuartzWindow.c |   42 +++++++++++++++++-------------------------
 1 files changed, 17 insertions(+), 25 deletions(-)
---
diff --git a/gdk/quartz/GdkQuartzWindow.c b/gdk/quartz/GdkQuartzWindow.c
index 7aab759..dabf051 100644
--- a/gdk/quartz/GdkQuartzWindow.c
+++ b/gdk/quartz/GdkQuartzWindow.c
@@ -183,28 +183,13 @@
     }
 }
 
--(void)windowDidMove:(NSNotification *)aNotification
-{
-  GdkWindow *window = [[self contentView] gdkWindow];
-  GdkWindowObject *private = (GdkWindowObject *)window;
-  GdkEvent *event;
-
-  _gdk_quartz_window_update_position (window);
-
-  /* Synthesize a configure event */
-  event = gdk_event_new (GDK_CONFIGURE);
-  event->configure.window = g_object_ref (window);
-  event->configure.x = private->x;
-  event->configure.y = private->y;
-  event->configure.width = private->width;
-  event->configure.height = private->height;
-
-  _gdk_event_queue_append (gdk_display_get_default (), event);
-
-  [self checkSendEnterNotify];
-}
-
--(void)windowDidResize:(NSNotification *)aNotification
+/* Always update both the position and size. Certain resize operations
+ * (e.g. going fullscreen) also move the origin of the window. Move
+ * notifications sometimes also indicate a different window size (for
+ * example if the window size requested in the configure request was not
+ * fully granted).
+ */
+-(void)handleDidMoveResize
 {
   NSRect content_rect = [self contentRectForFrameRect:[self frame]];
   GdkWindow *window = [[self contentView] gdkWindow];
@@ -214,9 +199,6 @@
   private->width = content_rect.size.width;
   private->height = content_rect.size.height;
 
-  /* Certain resize operations (e.g. going fullscreen), also move the
-   * origin of the window.
-   */
   _gdk_quartz_window_update_position (window);
 
   [[self contentView] setFrame:NSMakeRect (0, 0, private->width, private->height)];
@@ -236,6 +218,16 @@
   [self checkSendEnterNotify];
 }
 
+-(void)windowDidMove:(NSNotification *)aNotification
+{
+  [self handleDidMoveResize];
+}
+
+-(void)windowDidResize:(NSNotification *)aNotification
+{
+  [self handleDidMoveResize];
+}
+
 -(id)initWithContentRect:(NSRect)contentRect styleMask:(NSUInteger)styleMask 
backing:(NSBackingStoreType)backingType defer:(BOOL)flag screen:(NSScreen *)screen
 {
   self = [super initWithContentRect:contentRect


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