Bug 265505 - x11/plasma5-plasma: Wayland session doesn't work since Plasma 5.22
Summary: x11/plasma5-plasma: Wayland session doesn't work since Plasma 5.22
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Jan Beich
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-07-29 17:09 UTC by tino.engel
Modified: 2023-08-19 08:41 UTC (History)
7 users (show)

See Also:


Attachments
console log file (26.91 KB, text/plain)
2022-07-29 17:09 UTC, tino.engel
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description tino.engel 2022-07-29 17:09:48 UTC
Created attachment 235548 [details]
console log file

When starting plasma5 under wayland, it only shows the splash screen for some time, then switches to a black screen (which doesn't even have a mouse cursor).

I have started plasma5 with the follwing script (I left the commented out lines in there, since those are options I also have tried).

================
setenv XDG_RUNTIME_DIR /var/run/user/`id -u`
#setenv GTK_THEME Nordic-v40
#setenv LC_ALL de_DE.UTF-8
#setenv LANG de_DE.UTF-8

setenv XDG_SESSION_TYPE wayland
setenv GDK_BACKEND wayland
#setenv QT_QPA_PLATFORM wayland-egl
setenv QT_QPA_PLATFORM wayland
#setenv CLUTTER_BACKEND wayland
#setenv SDL_VIDEODRIVER wayland
#setenv MOZ_ENABLE_WAYLAND 1
#setenv LIBVA_DRIVER_NAME i965
setenv LOGFILE /home/elgrande/plasma-wayland.log
#setenv KWIN_COMPOSE Q
#setenv QT_WAYLAND_DISABLE_WINDOWDECORATION 1
setenv QT_LOGGING_RULES "kwin_core.debug=true;kwin_libinput.debug=true"

/usr/local/bin/startplasma-wayland.sh
#ck-launch-session dbus-run-session startplasma-wayland
================

Regardless of the options the screen always stays black after the splash screen.
It seems though that something is running, when I ssh to the machine, kwin is running and after some time, the lockscreen appears (without the possibility to do anything there).

I have attached the logfile to this bug report.
Please note that the last lines of the attached logfile are errors due to a hard reboot using the power button.
Comment 2 Jan Beich freebsd_committer freebsd_triage 2023-05-22 20:27:30 UTC
Applying only 94c58c9 from comment 1 appears enough to unbreak startplasma-wayland. Tested Plasma nested under Sway (with bug 271571 workaround).

Disclaimer: I don't use Plasma at all.
Comment 3 commit-hook freebsd_committer freebsd_triage 2023-08-19 00:51:50 UTC
A commit in branch main references this bug:

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

commit f06a1b44e85b9788c0e1ed718eca4146f102057f
Author:     Jessica Clarke <jrtc27@jrtc27.com>
AuthorDate: 2022-11-19 02:36:07 +0000
Commit:     Jan Beich <jbeich@FreeBSD.org>
CommitDate: 2023-08-19 00:49:20 +0000

    x11/plasma5-plasma-workspace: Fix XDG_CONFIG_DIRS for Wayland

    Since Plasma 5.22, setupPlasmaEnvironment adds to XDG_CONFIG_DIRS, with
    a fallback for the XDG-mandated /etc/xdg default. When using X11, this
    is ok, as runStartupConfig gets called before setupPlasmaEnvironment,
    and so the latter uses our modified value. However, when using Wayland,
    they are called in the opposite order, and so runStartupConfig sees the
    variable is already set and doesn't inject our modified default. Fix
    this by changing setupPlasmaEnvironment's default value instead so it's
    only set in one place. This approach also matches how other ports get
    patched for our non-conforming environment.

    Without this, the splash screen shows but plasmashell is never started
    (nor any other autostart programs), eventually timing out and fading to
    a black screen.

    PR:             265505
    Obtained from:  CheriBSD
    Approved by:    maintainer timeout (3 months)

 x11/plasma5-plasma-workspace/Makefile              |  6 ++++-
 .../files/patch-setup_xdg_environment              | 28 +++++++---------------
 2 files changed, 13 insertions(+), 21 deletions(-)
Comment 4 commit-hook freebsd_committer freebsd_triage 2023-08-19 00:52:52 UTC
A commit in branch 2023Q3 references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=40fe2d53bacf88e2c48282e62445f15e4a3d16b7

commit 40fe2d53bacf88e2c48282e62445f15e4a3d16b7
Author:     Jessica Clarke <jrtc27@jrtc27.com>
AuthorDate: 2022-11-19 02:36:07 +0000
Commit:     Jan Beich <jbeich@FreeBSD.org>
CommitDate: 2023-08-19 00:51:37 +0000

    x11/plasma5-plasma-workspace: Fix XDG_CONFIG_DIRS for Wayland

    Since Plasma 5.22, setupPlasmaEnvironment adds to XDG_CONFIG_DIRS, with
    a fallback for the XDG-mandated /etc/xdg default. When using X11, this
    is ok, as runStartupConfig gets called before setupPlasmaEnvironment,
    and so the latter uses our modified value. However, when using Wayland,
    they are called in the opposite order, and so runStartupConfig sees the
    variable is already set and doesn't inject our modified default. Fix
    this by changing setupPlasmaEnvironment's default value instead so it's
    only set in one place. This approach also matches how other ports get
    patched for our non-conforming environment.

    Without this, the splash screen shows but plasmashell is never started
    (nor any other autostart programs), eventually timing out and fading to
    a black screen.

    PR:             265505
    Obtained from:  CheriBSD
    Approved by:    maintainer timeout (3 months)

    (cherry picked from commit f06a1b44e85b9788c0e1ed718eca4146f102057f)

 x11/plasma5-plasma-workspace/Makefile              |  6 ++++-
 .../files/patch-setup_xdg_environment              | 28 +++++++---------------
 2 files changed, 13 insertions(+), 21 deletions(-)
Comment 5 Jessica Clarke freebsd_committer freebsd_triage 2023-08-19 01:09:39 UTC
FreeBSD should probably have the XDG_RUNTIME_DIR one, too, otherwise I don't think you'll be able to launch a Plasma (Wayland) session straight from SDDM, unless the recent SDDM release does things differently or there's something I'm missing about ConsoleKit? I couldn't obviously find where it would otherwise be set in a non-(e)logind world.
Comment 6 Jan Beich freebsd_committer freebsd_triage 2023-08-19 03:10:00 UTC
XDG_RUNTIME_DIR should be defined by ConsoleKit2 e.g., https://lists.freebsd.org/archives/freebsd-current/2023-June/003844.html

I'm unlikely to test Wayland support in SDDM until the port is flavorized to support Qt6 (don't want Qt5 here). Testing inside a jail and nested under Sway is tricky as SDDM wants root and/or system bus. Also downtime as SDDM may not like existing Sway intances or wipe /var/run/user due to ConsoleKit2 session tracking not being aware of pam_xdg. Testing SDDM + Plasma is even more PITA.
Comment 7 Tobias C. Berner freebsd_committer freebsd_triage 2023-08-19 04:54:47 UTC
(In reply to commit-hook from comment #3)
Thank you very much for this!

mfg Tobias
Comment 8 Gleb Popov freebsd_committer freebsd_triage 2023-08-19 08:41:36 UTC
(In reply to Jan Beich from comment #6)
Thanks for working on this, Jan!

I'm poking ConsoleKit and SDDM right now. Once I'm done and if you want to play with SDDM+Wayland I can prepare a flavorization patch.