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
This commit is contained in:
Olivier Fourdan 2016-10-06 16:49:39 +02:00
parent dd9a9d9dcc
commit 12579fe71b

View File

@ -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)