Bug 1430728 - [Wayland] - position wl_subsurface when attached GtkWidget allocation changes, r?jhorak
MozReview-Commit-ID: 1q3XIouxavQ
--- a/widget/gtk/mozcontainer.cpp
+++ b/widget/gtk/mozcontainer.cpp
@@ -419,16 +419,27 @@ moz_container_size_allocate (GtkWidget
gtk_widget_get_realized (widget)) {
gdk_window_move_resize(gtk_widget_get_window(widget),
allocation->x,
allocation->y,
allocation->width,
allocation->height);
}
+
+#if defined(MOZ_WAYLAND)
+ // We need to position our subsurface according to GdkWindow
+ // when offset changes (GdkWindow is maximized for instance).
+ // see gtk-clutter-embed.c for reference.
+ if (container->subsurface) {
+ gint x, y;
+ gdk_window_get_position(gtk_widget_get_window(widget), &x, &y);
+ wl_subsurface_set_position(container->subsurface, x, y);
+ }
+#endif
}
void
moz_container_remove (GtkContainer *container, GtkWidget *child_widget)
{
MozContainerChild *child;
MozContainer *moz_container;
GdkWindow* parent_window;