GNOME Bugzilla – Bug 754671
Improve dealing with foreign stages on GDK
Last modified: 2015-09-07 17:20:58 UTC
Here are a few improvement we can make in the GDK backend, in particular with foreign windows, we want to avoid doing any kind of processing when the stage in not visible.
Created attachment 310805 [details] [review] gdk: master-clock: disable vsync throttling When running with a master clock based on the GdkFrameClock, we get synchronized with the compositor, so no need for throttling rendering. In particular when dealing with foreign windows, we run into deadlocks in Mesa because of the way the Mesa wayland backend is implemented [1]. [1] : http://cgit.freedesktop.org/mesa/mesa/tree/src/egl/drivers/dri2/platform_wayland.c#n330
Created attachment 310806 [details] [review] gdk: master clock: only process mapped & realized stages When using Clutter embed inside a Gtk application, a stage might end up realized but not visible. In this case we might discard doing any kind of animation processing.
Created attachment 310807 [details] [review] gdk: stage: disable some operations for foreign windows Some operations like : * resize * show/hide * set_title * set_user_resizable should be handled by the embedding framework, so disable them for foreign windows.
Review of attachment 310805 [details] [review]: Yes, makes sense.
Review of attachment 310806 [details] [review]: ::: clutter/gdk/clutter-master-clock-gdk.c @@ +391,3 @@ { + ClutterActor *actor = CLUTTER_ACTOR (stage); + if (clutter_actor_is_mapped (actor) && clutter_actor_is_realized (actor)) The "mapped" state implies realization, which means that this is always going to be true. You can just replace the condition with is_mapped(). @@ +407,1 @@ g_signal_connect (stage, "notify::realized", If we're using the "mapped" state, then we don't need the "realized" one.
Review of attachment 310807 [details] [review]: Looks good.
Created attachment 310845 [details] [review] gdk: master clock: only process mapped & realized stages When using Clutter embed inside a Gtk application, a stage might end up realized but not visible. In this case we might discard doing any kind of animation processing.
Review of attachment 310845 [details] [review]: Okay.
Review of attachment 310805 [details] [review]: Pushed to master.
Review of attachment 310807 [details] [review]: Pushed to master.
Review of attachment 310845 [details] [review]: Pushed to master.