Bug 271571 - x11-wm/plasma5-kwin: fails to start nested under Wayland (wlroots)
Summary: x11-wm/plasma5-kwin: fails to start nested under Wayland (wlroots)
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-kde (group)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-05-22 19:54 UTC by Jan Beich
Modified: 2023-12-03 20:26 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Beich freebsd_committer freebsd_triage 2023-05-22 19:54:41 UTC
Regressed by https://invent.kde.org/plasma/kwin/-/commit/182026a4bd19 (kwin >= 5.27) and https://gitlab.freedesktop.org/wlroots/wlroots/-/commit/a04cfca4da42 (wlroots >= 0.15)
Fixed by https://invent.kde.org/plasma/kwin/-/commit/472b88d02af8
Affects debugging startplasma-wayland inside a jail e.g., bug 265505

$ pkg install cage
$ export XDG_RUNTIME_DIR=${XDG_RUNTIME_DIR=/tmp}
$ cage kwin_wayland
[...]
00:00:00.298 [types/wlr_linux_dmabuf_v1.c:265] dmabuf flags aren't supported
[destroyed object]: error 7: importing the supplied dmabufs failed
Wayland connection broke
Comment 1 Mina Galić freebsd_triage 2023-05-22 20:46:49 UTC
did you report this upstream, too?
Comment 2 Jan Beich freebsd_committer freebsd_triage 2023-05-22 21:12:11 UTC
(In reply to Mina Galić from comment #1)
I don't use Plasma and don't have a KDE account. comment 0 already references upstream fix but for Plasma 6.
Comment 3 Jan Beich freebsd_committer freebsd_triage 2023-08-19 08:37:52 UTC
Workaround: use KWin's X11 backend by hiding Wayland connection and switching X11 connection to a rootful Xwayland instance.

# Replace kwin_wayland with startplasma-wayland for something easier to use
$ env -u WAYLAND_DISPLAY DISPLAY=:$(Xwayland -retro -geometry 1024x768 -terminate -displayfd 1 2>/dev/null &) kwin_wayland

Implementation details:
* -retro: classic Xwayland background to distinguish from KWin's black background
* -geometry 1024x768: to match KWin's default if kwin_wayland is started by startplasma-wayland
* -terminate: exit Xwayland immediately after KWin exits
* -displayfd 1: output X11 connection path (dpy) to stdout
Comment 4 Jan Beich freebsd_committer freebsd_triage 2023-08-19 09:05:02 UTC
(In reply to Jan Beich from comment #3)
Beware, until bug 253277 is fixed running multiple Xwayland instances (e.g., rootless + rootful, rootless parent + rootless child) is fragile. I use the following to help recover

$ cat ~/.sway/config
[...]
# X11 sockets (real + pseudo-abstract) maybe overwritten by a compositor inside jail
exec mkdir -p /tmp/.X11-unix/backup && ln -f /tmp/.X11-unix/X${DISPLAY#:} /tmp/.X11-unix/X${DISPLAY#:}_ /tmp/.X11-unix/backup

For example,

$ glxgears
Error: couldn't open display :0
$ ln -f /tmp/.X11-unix/backup/* /tmp/.X11-unix/
$ glxgears
Running synchronized to the vertical refresh.  The framerate should be
approximately the same as the monitor refresh rate.
301 frames in 5.0 seconds = 60.000 FPS
^C
Comment 5 Jan Beich freebsd_committer freebsd_triage 2023-12-03 20:26:12 UTC
x11-wm/plasma6-kwin is not affected.