GNOME Bugzilla – Bug 754697
Use a wayland subsurface when dealing with foreign windows on GDK/wayland
Last modified: 2015-09-12 22:46:37 UTC
In the same way clutter-gtk uses a subsurface for clutter on top of GDK/wayland, we can use a subsurface in the GDK backend. That way we only deal with the embeding framework's events and frame synchronization, but our rendering is "sandboxed" to our own subsurface.
Created attachment 310846 [details] [review] gdk: stage: do not ensure native windows are created with foreign windows For foreign windows this should be dealt with by the embedding framework. In particular on Wayland with foreign windows, we might want to create a subsurface and use the foreign window only for events and frame clock synchronization.
Created attachment 310847 [details] [review] gdk: stage: report geometry of the underlying surface for foreign windows
Created attachment 310848 [details] [review] gdk: stage: create subsurface when dealing with foreign windows on wayland It is safer to create our own wayland surface when rendering into someone else GdkWindow, otherwise we might draw somewhere we didn't intend to.
Review of attachment 310846 [details] [review]: Okay.
Review of attachment 310847 [details] [review]: Okay.
Created attachment 310849 [details] [review] gdk: stage: report geometry of the underlying surface for foreign windows When running on wayland, we might have our own subsurface desynchronized from the foreign GdkWindow. It is important that we report the size of the actually surface we're rendering to, otherwise the logic in ClutterStage might discard resize operation that resynchronize the subsurface with the stage's size.
Sorry, just putting a better description. No change to the code.
Review of attachment 310848 [details] [review]: Looks generally good to me. If you could fix a minimal coding style issue before pushing, it would be great. ::: clutter/gdk/clutter-stage-gdk.c @@ +256,3 @@ + if (stage_gdk->foreign_window && + gdk_window_get_window_type (stage_gdk->window) == GDK_WINDOW_CHILD && + coding style: braces go on a new line, and a new indentation level.
Review of attachment 310849 [details] [review]: Okay.
Created attachment 310851 [details] [review] gdk: stage: create subsurface when dealing with foreign windows on wayland It is safer to create our own wayland surface when rendering into someone else GdkWindow, otherwise we might draw somewhere we didn't intend to.
Review of attachment 310846 [details] [review]: Pushed to master.
Review of attachment 310849 [details] [review]: Pushed to master.
Review of attachment 310851 [details] [review]: Pushed to master.