Bug 258042 - x11-wm/mutter: expose nested Wayland support
Summary: x11-wm/mutter: expose nested Wayland support
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-gnome (Nobody)
URL:
Keywords: patch
Depends on:
Blocks: 271836
  Show dependency treegraph
 
Reported: 2021-08-25 14:05 UTC by Jan Beich
Modified: 2024-10-13 15:53 UTC (History)
4 users (show)

See Also:
bugzilla: maintainer-feedback? (gnome)


Attachments
v1 (3.36.6) (13.09 KB, patch)
2021-08-25 14:05 UTC, Jan Beich
no flags Details | Diff
v1 (41.0) (20.33 KB, patch)
2021-10-02 10:47 UTC, Jan Beich
no flags Details | Diff
v1 (42.4) (9.03 KB, patch)
2023-06-04 20:56 UTC, Jan Beich
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Beich freebsd_committer freebsd_triage 2021-08-25 14:05:19 UTC
Created attachment 227426 [details]
v1 (3.36.6)

Given -Dnative_backend=false Wayland session currently can only be nested on top of Xorg (any WM) or Sway/Wayfire/hikari/etc (requires Xwayland) or Kwin (kwin_wayland): a Mutter window appears where one can launch other apps. Unlike Xephyr or Xnest the apps within such session still have GPU acceleration.

$ pkg install mutter glmark2 vkmark
$ ck-launch-session dbus-run-session mutter --wayland &
$ export WAYLAND_DISPLAY=$(sockstat -lu | awk '/mutter.*wayland/ { print $6; exit }')
$ export DISPLAY=$(sockstat -lu | awk -F/ "/$(pgrep -f mutter-Xwayland)/"' { sub(".*/X", ":"); print; exit }')
$ GDK_BACKEND=wayland gtk3-demo &
$ GDK_BACKEND=x11 gtk3-demo &
$ glmark2-wayland
$ glmark2
$ vkmark --winsys wayland
$ vkmark --winsys xcb
Comment 1 Jan Beich freebsd_committer freebsd_triage 2021-09-16 22:22:34 UTC
Ping. Did anyone test?
Comment 2 Jan Beich freebsd_committer freebsd_triage 2021-10-02 10:47:36 UTC
Created attachment 228353 [details]
v1 (41.0)
Comment 3 Jan Beich freebsd_committer freebsd_triage 2023-06-04 20:56:08 UTC
Created attachment 242599 [details]
v1 (42.4)

Rebased on top of bug 271823 + bug 271824.
Comment 4 Olivier Duchateau 2023-12-27 15:50:59 UTC
I use your patch with the latest release of mutter (45.2) on GNOME (I have also enabled wayland in various ports), and I noticed, it's always the X11 backend which is used. Even if I "export" several variables:

>export XDG_SESSION_TYPE=wayland
>export XDG_RUNTIME_DIR=/var/run/user/`id -u`
>export WAYLAND_DISPLAY=wayland-0
>
># Set $DESKTOP_SESSION
>if test "x$DESKTOP_SESSION" = "x" ; then
>    #DESKTOP_SESSION="gnome-xorg"
>    DESKTOP_SESSION="gnome-wayland"
>fi

The value of variable DESKTOP_SESSION is always "gnome" (like GDMSESSION).

I wonder if patch from bug #271836 is required too. Otherwise everything is fine.