[gtk+] gdkwindow: configure native windows in move_native_children()



commit 9e2b1ad39e86b2352116f49214cf195cb3e0e970
Author: Olivier Fourdan <ofourdan redhat com>
Date:   Thu Oct 6 16:49:39 2016 +0200

    gdkwindow: configure native windows in move_native_children()
    
    ClutterEmbed on Wayland uses a subsurface and relocates it on configure
    events, but when placed within a scrolled window, no configure event is
    emitted and the ClutterEmbed subsurface remains static.
    
    Emit a configure event for native windows in GdkWindow's internal
    move_native_children() so that custom widgets relying on configure
    events such as ClutterEmbed can relocate their stuff.
    
    Similarly, when switching to/from normal/maximized/fullscreen states
    which change the shadows' size and possibly shows/hides a header bar,
    we need to emit a configure event even if the abs_x/abs_y haven't
    changed to make sure the subsurface is size appropriately.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=771320
    https://bugzilla.gnome.org/show_bug.cgi?id=767713

 gdk/gdkwindow.c |   26 +++++++++++++++++++++++---
 1 files changed, 23 insertions(+), 3 deletions(-)
---
diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c
index 514732d..bc156dd 100644
--- a/gdk/gdkwindow.c
+++ b/gdk/gdkwindow.c
@@ -5972,6 +5972,24 @@ gdk_window_move_resize_toplevel (GdkWindow *window,
   _gdk_synthesize_crossing_events_for_geometry_change (window);
 }
 
+static void
+configure_native_child (GdkWindow *window)
+{
+  GdkDisplay *display;
+  GdkEvent *event;
+
+  event = gdk_event_new (GDK_CONFIGURE);
+
+  event->configure.window = g_object_ref (window);
+  event->configure.send_event = FALSE;
+  event->configure.x = window->x;
+  event->configure.y = window->y;
+  event->configure.width = window->width;
+  event->configure.height = window->height;
+
+  gdk_event_put (event);
+  gdk_event_free (event);
+}
 
 static void
 move_native_children (GdkWindow *private)
@@ -5992,7 +6010,10 @@ move_native_children (GdkWindow *private)
                                   child->width, child->height);
        }
       else
-       move_native_children  (child);
+        {
+          configure_native_child (child);
+          move_native_children (child);
+        }
     }
 }
 
@@ -6080,8 +6101,7 @@ gdk_window_move_resize_internal (GdkWindow *window,
                               window->x, window->y,
                               window->width, window->height);
     }
-  else if (old_abs_x != window->abs_x ||
-          old_abs_y != window->abs_y)
+  else
     move_native_children (window);
 
   if (expose)


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