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 754697 - Use a wayland subsurface when dealing with foreign windows on GDK/wayland
Use a wayland subsurface when dealing with foreign windows on GDK/wayland
Status: RESOLVED FIXED
Product: clutter
Classification: Platform
Component: gdk
unspecified
Other All
: Normal normal
: ---
Assigned To: clutter-maint
clutter-maint
Depends on:
Blocks:
 
 
Reported: 2015-09-07 16:54 UTC by Lionel Landwerlin
Modified: 2015-09-12 22:46 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gdk: stage: do not ensure native windows are created with foreign windows (1.37 KB, patch)
2015-09-07 16:54 UTC, Lionel Landwerlin
committed Details | Review
gdk: stage: report geometry of the underlying surface for foreign windows (1.44 KB, patch)
2015-09-07 16:54 UTC, Lionel Landwerlin
none Details | Review
gdk: stage: create subsurface when dealing with foreign windows on wayland (9.13 KB, patch)
2015-09-07 16:54 UTC, Lionel Landwerlin
none Details | Review
gdk: stage: report geometry of the underlying surface for foreign windows (1.74 KB, patch)
2015-09-07 16:58 UTC, Lionel Landwerlin
committed Details | Review
gdk: stage: create subsurface when dealing with foreign windows on wayland (9.15 KB, patch)
2015-09-07 17:16 UTC, Lionel Landwerlin
committed Details | Review

Description Lionel Landwerlin 2015-09-07 16:54:00 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.
Comment 1 Lionel Landwerlin 2015-09-07 16:54:03 UTC
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.
Comment 2 Lionel Landwerlin 2015-09-07 16:54:08 UTC
Created attachment 310847 [details] [review]
gdk: stage: report geometry of the underlying surface for foreign windows
Comment 3 Lionel Landwerlin 2015-09-07 16:54:12 UTC
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.
Comment 4 Emmanuele Bassi (:ebassi) 2015-09-07 16:56:51 UTC
Review of attachment 310846 [details] [review]:

Okay.
Comment 5 Emmanuele Bassi (:ebassi) 2015-09-07 16:57:29 UTC
Review of attachment 310847 [details] [review]:

Okay.
Comment 6 Lionel Landwerlin 2015-09-07 16:58:06 UTC
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.
Comment 7 Lionel Landwerlin 2015-09-07 16:58:49 UTC
Sorry, just putting a better description. No change to the code.
Comment 8 Emmanuele Bassi (:ebassi) 2015-09-07 17:07:27 UTC
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.
Comment 9 Emmanuele Bassi (:ebassi) 2015-09-07 17:08:16 UTC
Review of attachment 310849 [details] [review]:

Okay.
Comment 10 Lionel Landwerlin 2015-09-07 17:16:27 UTC
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.
Comment 11 Lionel Landwerlin 2015-09-07 17:21:21 UTC
Review of attachment 310846 [details] [review]:

Pushed to master.
Comment 12 Lionel Landwerlin 2015-09-07 17:21:31 UTC
Review of attachment 310849 [details] [review]:

Pushed to master.
Comment 13 Lionel Landwerlin 2015-09-07 17:21:41 UTC
Review of attachment 310851 [details] [review]:

Pushed to master.