After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 754891 - Rework foreign stage setup to work on gdk/wayland
Rework foreign stage setup to work on gdk/wayland
Status: RESOLVED FIXED
Product: clutter-gtk
Classification: Platform
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: clutter-gtk maintainer(s)
clutter-gtk maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2015-09-11 15:55 UTC by Lionel Landwerlin
Modified: 2015-09-11 22:54 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
embed: rework foreign stage setup to work on gdk/wayland (15.33 KB, patch)
2015-09-11 15:55 UTC, Lionel Landwerlin
committed Details | Review

Description Lionel Landwerlin 2015-09-11 15:55:51 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.
Comment 1 Lionel Landwerlin 2015-09-11 15:55:55 UTC
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
Comment 2 Emmanuele Bassi (:ebassi) 2015-09-11 16:30:23 UTC
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.
Comment 3 Lionel Landwerlin 2015-09-11 22:54:00 UTC
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.