Bug 258042 - x11-wm/mutter: expose nested Wayland support
Summary: x11-wm/mutter: expose nested Wayland support
Status: Closed FIXED
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:
Depends on:
Blocks: 271836
  Show dependency treegraph
 
Reported: 2021-08-25 14:05 UTC by Jan Beich
Modified: 2025-06-11 07:13 UTC (History)
5 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.
Comment 5 commit-hook freebsd_committer freebsd_triage 2025-06-10 13:53:04 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=2e75d18c1b26de6d114efbc19647cb4326bb914f

commit 2e75d18c1b26de6d114efbc19647cb4326bb914f
Author:     Olivier Duchateau <duchateau.olivier@gmail.com>
AuthorDate: 2025-06-10 13:27:33 +0000
Commit:     Baptiste Daroussin <bapt@FreeBSD.org>
CommitDate: 2025-06-10 13:46:21 +0000

    x11-wm/mutter: update to 47.8.1

    - enable evdev/udev support
    - enable DMA_BUF_SYNC
    - expose nested wayland support

    PR:     286697, 271824, 271823, 258042

 x11-wm/mutter/Makefile                             |  67 +--
 x11-wm/mutter/distinfo                             |   6 +-
 ...tch-clutter_clutter_clutter-stage-view.c (gone) |  58 ---
 .../files/patch-cogl_cogl_cogl-dma-buf-handle.c    |  45 +-
 .../patch-cogl_cogl_cogl-dma-buf-handle.h (gone)   |  22 -
 ...c_backends_x11_meta-input-settings-x11.c (gone) |  39 --
 .../patch-src_backends_x11_meta-seat-x11.c (gone)  |  44 --
 x11-wm/mutter/pkg-descr                            |  13 +-
 x11-wm/mutter/pkg-plist                            | 473 ++++++++++-----------
 9 files changed, 304 insertions(+), 463 deletions(-)
Comment 6 Baptiste Daroussin freebsd_committer freebsd_triage 2025-06-11 07:13:13 UTC
merge during the update