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 791938 - Add xdg-shell (stable) support
Add xdg-shell (stable) support
Status: RESOLVED OBSOLETE
Product: mutter
Classification: Core
Component: wayland
unspecified
Other All
: Normal normal
: ---
Assigned To: mutter-maint
mutter-maint
Depends on:
Blocks:
 
 
Reported: 2017-12-25 06:49 UTC by Jonas Ådahl
Modified: 2018-01-29 08:53 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
.gitignore: Add more things to ignore (1.02 KB, patch)
2017-12-25 06:49 UTC, Jonas Ådahl
none Details | Review
src/Makefile.am: Remove redundant rule (1.16 KB, patch)
2017-12-25 06:49 UTC, Jonas Ådahl
none Details | Review
wayland: Shorten MetaWaylandSurfaceRoleShellSurface name (28.55 KB, patch)
2017-12-25 06:49 UTC, Jonas Ådahl
none Details | Review
wayland/xdg-shell: Cleanup object class interface vfunc names (12.44 KB, patch)
2017-12-25 06:49 UTC, Jonas Ådahl
none Details | Review
wayland/xdg-shell: Cleanup xdg_positioner Wayland vfunc naming (5.91 KB, patch)
2017-12-25 06:49 UTC, Jonas Ådahl
none Details | Review
wayland/xdg-shell: Minor cosmetic cleanups (2.41 KB, patch)
2017-12-25 06:49 UTC, Jonas Ådahl
none Details | Review
wayland/surface: Stop using deprecated g_object_newv (4.87 KB, patch)
2017-12-25 06:50 UTC, Jonas Ådahl
none Details | Review
wayland: Restructure surface role building blocks code (62.95 KB, patch)
2017-12-25 06:50 UTC, Jonas Ådahl
none Details | Review
xwayland: Base Xwayland surface role object on the actor role (3.21 KB, patch)
2017-12-25 06:50 UTC, Jonas Ådahl
none Details | Review
surface-actor/wayland: Minor style fixes (1.70 KB, patch)
2017-12-25 06:50 UTC, Jonas Ådahl
none Details | Review
wayland: Push actor state instead of itself pulling (36.53 KB, patch)
2017-12-25 06:50 UTC, Jonas Ådahl
none Details | Review
wayland: Use helper to set shell surface window (5.10 KB, patch)
2017-12-25 06:50 UTC, Jonas Ådahl
none Details | Review
wayland: Add support for stable xdg-shell (126.79 KB, patch)
2017-12-25 06:50 UTC, Jonas Ådahl
none Details | Review
Log of running kodi with WAYLAND_DEBUG=1 (19.32 KB, text/plain)
2018-01-11 09:32 UTC, 28872d13
  Details

Description Jonas Ådahl 2017-12-25 06:49:26 UTC
The last patch adds support for xdg-shell (stable). The patches prior to that one are variosu clean ups and preparations.
Comment 1 Jonas Ådahl 2017-12-25 06:49:30 UTC
Created attachment 365950 [details] [review]
.gitignore: Add more things to ignore

Various protocol files had not been added.
Comment 2 Jonas Ådahl 2017-12-25 06:49:36 UTC
Created attachment 365951 [details] [review]
src/Makefile.am: Remove redundant rule

The rules above handle all unstable protocols from Wayland protocol, so
no need to add per protocol rules.
Comment 3 Jonas Ådahl 2017-12-25 06:49:41 UTC
Created attachment 365952 [details] [review]
wayland: Shorten MetaWaylandSurfaceRoleShellSurface name

It was annoyingly long, so rename it to MetaWaylandShellSurface.
Comment 4 Jonas Ådahl 2017-12-25 06:49:47 UTC
Created attachment 365953 [details] [review]
wayland/xdg-shell: Cleanup object class interface vfunc names

Follow the convention that MetaSomeObject's class vfuncs should be
named meta_some_object_said_vfunc.
Comment 5 Jonas Ådahl 2017-12-25 06:49:52 UTC
Created attachment 365954 [details] [review]
wayland/xdg-shell: Cleanup xdg_positioner Wayland vfunc naming

Use the convention [interface]_[request] (..) used elsewhere in the
file.
Comment 6 Jonas Ådahl 2017-12-25 06:49:57 UTC
Created attachment 365955 [details] [review]
wayland/xdg-shell: Minor cosmetic cleanups
Comment 7 Jonas Ådahl 2017-12-25 06:50:02 UTC
Created attachment 365956 [details] [review]
wayland/surface: Stop using deprecated g_object_newv

Replace it with g_object_new_with_properties. This fixes a warning
about using deprecated API.
Comment 8 Jonas Ådahl 2017-12-25 06:50:08 UTC
Created attachment 365957 [details] [review]
wayland: Restructure surface role building blocks code

This commit moves out non-core wl_surface related code into separate
code units, while renaming types to fit a common scheme. The changes
done are:

 * ClutterActor based surface roles built upon
   MetaWalyandSurfaceRoleActorSurface. This object has been renamed to
   MetaWaylandActorSurface and related functionality has moved into
   meta-wayland-actor-surface.c.

 * The code related to roles backed by a MetaWindow (i.e. built upon
   MetaWaylandShellSurface) was moved into meta-wayland-shell-surface.c

 * The majority of subsurface related code was moved into into
   meta-wayland-subsurface.c and the object was renamed
   MetaWaylandSubsurface.
Comment 9 Jonas Ådahl 2017-12-25 06:50:13 UTC
Created attachment 365958 [details] [review]
xwayland: Base Xwayland surface role object on the actor role

The Xwayland role uses a MetaSurfaceActorWayland just so lets share
logic related to it. As a side effect, wl_surface.enter/leave starts
working for Xwayland surfaces.
Comment 10 Jonas Ådahl 2017-12-25 06:50:19 UTC
Created attachment 365959 [details] [review]
surface-actor/wayland: Minor style fixes
Comment 11 Jonas Ådahl 2017-12-25 06:50:24 UTC
Created attachment 365960 [details] [review]
wayland: Push actor state instead of itself pulling

Make the Wayland objects push the state relevant to their role to the
MetaSurfaceActor instead of MetaSurfaceActorWayland pulling the state
from the associated surface.

This makes the relationship between the actor and the objects that
constructs it more clear; the actor is a drawable that the protocol
objects control, not the other way around.

This will make it easier to "detach" a surface actor from a surface,
which is necessary when unmapping a window while the underlying surface
is yet to be destroyed and potentially reused.
Comment 12 Jonas Ådahl 2017-12-25 06:50:30 UTC
Created attachment 365961 [details] [review]
wayland: Use helper to set shell surface window

The helper deals with updating the surface output state.
Comment 13 Jonas Ådahl 2017-12-25 06:50:37 UTC
Created attachment 365962 [details] [review]
wayland: Add support for stable xdg-shell

This commit adds support for xdg_shell (the stable version). This was
done by first copying the old xdg-shell unstable v6 implementation into
a separate .c .h file pair (including various symbol renaming) then
porting the old xdg-shell unstable v6 implementation to the new stable
version.
Comment 14 28872d13 2018-01-11 09:29:45 UTC
As discussed on IRC, I get a crash when running Kodi. It occurs both when using zxdg_shell_unstable_v6 with the same Kodi code that works on master as well as when using the new xdg_wm_base code (have not tested wl_shell). I'll attach the backtrace.
Comment 15 28872d13 2018-01-11 09:30:55 UTC


  • #0 meta_wayland_buffer_get_texture
    at wayland/meta-wayland-buffer.c line 373
  • #1 meta_wayland_subsurface_union_geometry
    at wayland/meta-wayland-subsurface.c line 159
  • #2 meta_wayland_shell_surface_calculate_geometry
    at wayland/meta-wayland-shell-surface.c line 66
  • #3 meta_wayland_zxdg_surface_v6_commit
    at wayland/meta-wayland-legacy-xdg-shell.c line 1312
  • #4 meta_wayland_zxdg_toplevel_v6_commit
    at wayland/meta-wayland-legacy-xdg-shell.c line 606
  • #5 meta_wayland_surface_role_commit
    at wayland/meta-wayland-surface.c line 1604
  • #6 meta_wayland_surface_apply_pending_state
    at wayland/meta-wayland-surface.c line 661
  • #7 ffi_call_unix64
    from /usr/lib/libffi.so.6
  • #8 ffi_call
    from /usr/lib/libffi.so.6
  • #9 ??
    from /usr/lib/libwayland-server.so.0
  • #10 ??
    from /usr/lib/libwayland-server.so.0
  • #11 wl_event_loop_dispatch
    from /usr/lib/libwayland-server.so.0
  • #12 wayland_event_source_dispatch
    at wayland/meta-wayland.c line 86
  • #13 g_main_dispatch
    at gmain.c line 3148
  • #14 g_main_context_dispatch
    at gmain.c line 3813
  • #15 g_main_context_iterate
    at gmain.c line 3886
  • #16 g_main_loop_run
    at gmain.c line 4082
  • #17 meta_run
    at core/main.c line 648
  • #18 main
    at core/mutter.c line 85

Comment 16 28872d13 2018-01-11 09:32:51 UTC
Created attachment 366643 [details]
Log of running kodi with WAYLAND_DEBUG=1
Comment 17 28872d13 2018-01-11 09:36:39 UTC
Sorry, seems there was some confusion. To be clear: There is no crash on mutter master when using zxdg_shell_unstable_v6. It is definitely introduced by the patches here.
Comment 18 Jonas Ådahl 2018-01-29 08:53:02 UTC
I created this merge request instead:
https://gitlab.gnome.org/GNOME/mutter/merge_requests/5

So closing this one.

(In reply to k.philipp from comment #17)
> Sorry, seems there was some confusion. To be clear: There is no crash on
> mutter master when using zxdg_shell_unstable_v6. It is definitely introduced
> by the patches here.

I think I have fixed the issue you reported. Do you have any chance to git the MR a test run?