GNOME Bugzilla – Bug 754891
Rework foreign stage setup to work on gdk/wayland
Last modified: 2015-09-11 22:54:28 UTC
Wayland works differently from X11 when it comes to hide a surface (the equivalent of a X11 window). Indeed on Wayland you have to destroy a surface if you want to hide it. As a result we need to rethink a bit the Clutter-Gtk strategy to deal with the GDK backend. The attached patches considers that a ClutterStage must be unrealized when its embedding GtkWidget is not visible anymore.
Created attachment 311162 [details] [review] embed: rework foreign stage setup to work on gdk/wayland On hide/unmap the GDK wayland backend might decide to destroy its wayland surface [1]. There is no event notifying Clutter/Cogl of this. We need to notify Clutter/Cogl that the surface has changed when the embed widget becomes visible/invisible. So instead of mapping the different mapped/visible/realized properties of the GtkWidget to the ClutterStage, we take a different approach by considering that an invisible GtkWidget means an unrealized ClutterStage. [1] : https://git.gnome.org/browse/gtk+/commit/?id=87e2a7d4b23e633d0f2263d6ebd205c113eede0f
Review of attachment 311162 [details] [review]: Looks generally good to me. ::: clutter-gtk/gtk-clutter-embed.c @@ +242,3 @@ + return; + + priv->clutter_surface = wl_compositor_create_surface (compositor); This should be `clutter_actor_is_realized()`. The macro has been deprecated in 1.23. You'll need to bump up the required Clutter version.
Review of attachment 311162 [details] [review]: ::: clutter-gtk/gtk-clutter-embed.c @@ +242,3 @@ + return; + + priv->clutter_surface = wl_compositor_create_surface (compositor); Done. Also bumped the GTK+ dependency in a separate commit.