GNOME Bugzilla – Bug 736564
problem with gtkclutterembed and gtkstack under wayland
Last modified: 2014-09-18 23:40:49 UTC
Created attachment 286042 [details] gtk-clutter-multistage.c the offscreen is 'popping out'. I'll attach a slightly edited copy of gtk-clutter-multistage.c that shows it, and a screenshot.
Created attachment 286043 [details] screenshot
Created attachment 286052 [details] [review] Wip: Fix positioning of subsurfaces with GtkStack The subsurface needs to be placed at an offset relative to the toplevel, not to the parent widget. Therefore, use gdk_window_get_origin instead of the widget allocation. The initial position is still wrong here for some reason, after the first allocation, things snap into the right place.
max/unmax gets things out of sync again.
Created attachment 286181 [details] [review] Use GDK support for subsurfaces Instead of manually creating a subsurface and (failing to) keep it positioned manually, use the GDK support for subsurfaces.
I haven't been able to track down why this patch causes memory corruption and crashes.
(In reply to comment #5) > I haven't been able to track down why this patch causes memory corruption and > crashes. I didn't get any memory corruption when using your test from comment 0. I would merge your 2 patches and propose it for an updated clutter-gtk. But I do get: - 2 flickery video displays when using cheese (which doesn't use a GtkStack) - mouse events going nowhere (buttons not working, hidden video texture) in totem I can reproduce the latter with another test program. Given that it only happens when using clutter-gst inside clutter-gtk, I would consider it a clutter-gst bug.
Filed the clutter-gst section as bug 736677.
Review of attachment 286181 [details] [review]: it will likely need a bump in the GTK+ requirement, but I can live with that.
Created attachment 286386 [details] [review] Use GDK support for subsurfaces Instead of manually creating a subsurface and (failing to) keep it positioned manually, use the GDK support for subsurfaces.
Comment on attachment 286386 [details] [review] Use GDK support for subsurfaces This is currently unusable.
Created attachment 286410 [details] [review] gtk-clutter-embed: Fix hiding embed inside container Such as the embed inside a GtkStack, as used in Cheese or Totem. With help from Matthias Clasen (positioning inside the window), and Jasper St. Pierre (Wayland API help).
Review of attachment 286410 [details] [review]: looks okay to me, with two minor fixes. ::: clutter-gtk/gtk-clutter-embed.c @@ +297,3 @@ + return; + + gtk_widget_get_allocation (GTK_WIDGET (embed), &allocation); considering the amount of calls that take a GTK_WIDGET (embed), it'd be better to just cast it once. @@ +302,3 @@ + + priv->subsurface = + wl_subcompositor_get_subsurface (priv->subcompositor, coding style: only two spaces for the indentation of the call to wl_subcompositor_get_subsurface().
This works for me with Totem and Cheese. The multi-stage doesn't work, seems to get stuck deep inside the video driver [1]. I'd punt this for a later look. [1]:
+ Trace 234101
Created attachment 286413 [details] [review] gtk-clutter-embed: Fix hiding embed inside container Such as the embed inside a GtkStack, as used in Cheese or Totem. With help from Matthias Clasen (positioning inside the window), and Jasper St. Pierre (Wayland API help).
Attachment 286413 [details] pushed as 062ddb7 - gtk-clutter-embed: Fix hiding embed inside container
Hang filed as https://bugs.freedesktop.org/show_bug.cgi?id=84016
(In reply to comment #16) > Hang filed as https://bugs.freedesktop.org/show_bug.cgi?id=84016 That bt looks familiar to me... Is eglSwapInterval(dpy, 0) being called when making the context current? Otherwise the wayland platform code in mesa will schedule its own wl_surface_frame().
You can force the eglSwapInterval(dpy, 0) by setting CLUTTER_VBLANK=none, but that doesn't fix the problem. It seems to be a genuine problem with Mesa synchronization implementation. get_back_bo() seems to be called outside of the SwapBuffers() operation, this doesn't seem like the place where you want to synchronize stuff :| Still investigating...