KDE Plasma (Wayland) and SDDM Queries

At present, the version of sddm shipping with Tumbleweed does not offer the possibility of running as a wayland session, it’s X11 only.

What do I mean by that?

sddm itself currently runs in X11, and then when you login to a Plasma-wayland session, it switches to wayland. There are fixes/updates coming, there is just some issues upstream that are holding up a fresh sddm release.

So for the moment, at least on openSUSE, unless you’re going to pull in an sddm git pull from a devel project, having a pure wayland environment isn’t possible.

I switched to Wayland for a few hours before I had to rollback. There were two glaring issues.

  1. You can’t actually access your settings anymore. All gui applications which adjust systemwide settings now throw Wayland does not support QWindow::requestActivate() errors. Making adjusting anything after switching to Wayland an impossible feat.

  2. Wayland has no definable way of setting a “primary” monitor, there’s no such thing in Wayland. I have two monitors stacked on top of eachother, display port on bottom, hdmi on top. Wayland was defaulting applications to the top screen no matter what because I guess hdmi comes before displayport in whatever order it looks for monitors. If I fired up a game, it would force it on the 60hz monitor, not the 144hz one.

KWin should handle the preferred display layout, and remember the desired window placement of a given application when next opened.

Which applications are causing this behaviour?

If it’s an application that can be launched by y2controlcenter or systemsettings (including those applications themselves) the error was thrown. I’m not about to make a list of them all.

I don’t know what went wrong, but if I had the game Windowed, of course I could drag it to the lower monitor. If I tried to fullscreen/borderless window the application, it would force on HDMI. X11 session always had placement on displayport, so if wayland kept it’s own settings separate, it always put the desired window as HDMI, regardless if I closed the window on the displayport monitor, it would reopen to those coordinates on the HDMI monitor.

EDIT: I’ve swapped to Wayland after making a snapshot to see if I could reproduce this behavior. So far it’s fine. I am unsure how these previous hiccups happened but will update as soon as I run into them.

Ok, I haven’t observed that, but was just trying to get a handle on whether this was occurring with XWayland launched apps, GTK apps etc. In any case, when you get such an issue, best to start your own dedicated thread discussing such.

Wayland is just a protocol - it is KWin (the window manager acting as the Wayland compositor) that is responsible for this behaviour, and that may be totally different to how other such (Wayland) compositing window managers behave.

I do not have that file but based on the suggestion of @deano_ferrari I did boot my machine, did Log out, change for X11 to Wayland in the Log in screen and after that I see:

> sudo cat /var/lib/sddm/state.conf
[sudo] password for root:
[Last]
# Name of the last logged-in user.
# This user will be preselected when the login screen appears
User=marel

# Name of the session for the last logged-in user.
# This session will be preselected when the login screen appears.
Session=/usr/share/wayland-sessions/plasmawayland.desktop

So the last line changed, it was /usr/share/xsessions/default.desktop and now this plasmawayland.desktop file has:

[Desktop Entry]
Exec=/usr/libexec/plasma-dbus-run-session-if-needed /usr/bin/startplasma-wayland
TryExec=/usr/bin/startplasma-wayland
DesktopNames=KDE
Name=Plasma (Wayland)

Unfortunately, after a reboot (initiate with Wayland active and the sddm/state.conf as above) I still boot (autologin - so no login screen) into X11. I also tried adding “RememberLastSession=true” in a /etc/sddm.conf.d/ file but still after a reboot I have X11.

Next I did check the SDDM configuration:

> cat /usr/lib/sddm/sddm.conf.d/00-general.conf
[XDisplay]
ServerPath=/usr/bin/X
SessionCommand=/usr/etc/X11/xdm/Xsession
DisplayCommand=/usr/etc/X11/xdm/Xsetup
MinimumVT=7
# boo#1089932
EnableHiDPI=true

[Users]
# boo#979775
ReuseSession=true

So that is all X11, I guess I have to create a file in /etc/sddm.conf.d/ to override these settings to Wayland equivalents.

Isn’t that way is being addressed in Running under Wayland?

I know how I can check that KDE is running Wayland (echo $XDG_SESSION_TYPE) but how do I check what SDDM is running?

Yes, it is being addressed as already mentioned. However, it isn’t released as an openSUSE package yet. You can test sddm 0.20 with full Wayland support (via sddm-git), but I’m not sure what dependency issues you may run into. More info here:
https://wiki.archlinux.org/title/SDDM

Run

ps -ef | grep sddm

and you’ll see it is launched on tty7 as a process running under X.

1 Like

Watch the journal:

erlangen:~ # journalctl --since 5:00 -u display-manager.service -p6
May 29 05:09:28 erlangen sddm-helper[8004]: pam_unix(sddm-greeter:session): session opened for user sddm(uid=477) by sddm(uid=0)
May 29 05:09:44 erlangen sddm-helper[8070]: pam_unix(sddm:session): session opened for user tester(uid=1005) by tester(uid=0)
May 29 05:09:44 erlangen sddm-helper[8070]: Starting: "/usr/share/sddm/scripts/wayland-session /usr/libexec/plasma-dbus-run-session-if-needed /usr/bin/startplasma-wayland"
erlangen:~ # 

This is caused by SUSE patch that sets default session for autologin to X11. You need to explicitly reset it (set it to empty) in sddm.conf, then it will pick up the value from state.conf. Or explicitly set session you want in sddm.conf.

1 Like

Thanks for linking this other thread. It list more links and my conclusion from that is that if you get autologin with Wayland working you can run into a black screen with no cursor although @karlmistelberger reports succes.

Anyhow I tried and follow the instructions and things work for me, nice.

During the boot the screen flashes one time, some thing I did not see before but that is likely because SDDM is still running on X11:

> sudo journalctl -b -u display-manager.service -p6
May 29 21:51:22 systemd[1]: Starting X Display Manager…
May 29 21:51:22 display-manager[1451]: /etc/vconsole.conf available
May 29 21:51:22 display-manager[1451]: XKBLAYOUT: us
May 29 21:51:22 display-manager[1451]: XKBLAYOUT is already set. Better don’t touch X11 keyboard configuration.
May 29 21:51:23 systemd[1]: Started X Display Manager.
May 29 21:51:23 sddm-helper[1666]: pam_unix(sddm-autologin:session): session opened for user marel(uid=1000) by marel(uid=0)
May 29 21:51:23 sddm-helper[1666]: pam_kwallet5(sddm-autologin:session): pam_kwallet5: open_session called without kwallet5_key
May 29 21:51:23 sddm[1460]: Authentication information: “Last login: Mon May 29 21:46:46 CEST 2023 from :0 on tty7”
May 29 21:51:23 sddm-helper[1666]: Starting: “/usr/share/sddm/scripts/wayland-session /usr/libexec/plasma-dbus-run-session-if-needed /usr/bin/startplasma-wayland”

Not a big problem, so let me wait for that until a ssdm update with better wayland support and try to fix that afterwards.

What is not working yet nicely is shutting down the machine, X11 is the culprit but nothing in the journal likely because the journal is stopped before X11 is terminated. During the shut down I see it hang two times on X11, the first time it seems to time out and continue after 30 seconds and then at the end and that seems to take about 2 minutes.

1 Like

I was also having the shutdown/reboot issue a couple of weeks ago. The problem only lasted a few days and fixed itself, but it was quite annoying.

In the mean time, I edited /etc/systemd/user.conf

Change the following
#DefaultTimeoutStopSec=90s
to
DefaultTimeoutStopSec=15s

and you won’t have to wait so long when it does hang. Fedora just changed this as a default, because they said it was useless to have to wait so long. If a service has not shutdown in 15 seconds, it is not going to shutdown and should just be killed.

2 Likes

Thanks for the hint to reduce the default timeout. Makes good sense, but for now I leave the 90 seconds default so I notice. I might try to play with an updated sddm to see if I can get sddm also to run on Wayland so X11 is not started at all.

I did run:

> inxi -G
Graphics:
Device-1: Intel Xeon E3-1200 v3/4th Gen Core Processor Integrated Graphics
driver: i915 v: kernel
Display: wayland server: X.org v: 1.21.1.8 with: Xwayland v: 23.1.1
compositor: kwin_wayland driver: X: loaded: modesetting unloaded: fbdev,vesa
dri: crocus gpu: i915 resolution: 2560x1440
API: OpenGL v: 4.6 Mesa 23.0.3 renderer: Mesa Intel HD Graphics 4600 (HSW GT2)

So it looks (server: X.org, driver: X) like I am running more X11 still then expected.

Is this because KDE does not support Wayland completely (and that will be fixed for KDE Plasma 6)?

No, it is not that KDE does not support Wayland completely (as you can see the compositor is reported as kwin_wayland), but SDDM is still starting via an X11 session.

Yes, let us know how you get on with this. I couldn’t satisfy the dependencies when I tried it for Leap 15.4 a month or so ago.

Alternatively, switch to the gdm display-manager, which launches its own wayland session…

~> ps -ef |grep X
dean      1787  1746  0 19:21 ?        00:00:00 /usr/bin/Xwayland :0 -auth /run/user/1000/xauth_GHSyOf -listen 45 -listen 46 -displayfd 37 -rootless -wm 40
dean      2420  2305  0 19:22 pts/1    00:00:00 grep --color=auto X
~> ps -a |grep X
~> ps -ef |grep gdm
root      1113     1  0 19:20 ?        00:00:00 /usr/sbin/gdm
root      1702  1113  0 19:20 ?        00:00:00 gdm-session-worker [pam/gdm-password]
dean      1729  1702  0 19:21 tty2     00:00:00 /usr/lib/gdm/gdm-wayland-session --register-session /usr/lib/plasma-dbus-run-session-if-needed /usr/bin/startplasma-wayland
dean      2823  2305  0 19:29 pts/1    00:00:00 grep --color=auto gdm

I have now encountered too many annoyances in Wayland that I want to go back to X11 but switching now only throws me to tty. Incredibly frustrating, but adding to my +1 of anti-wayland.

Well this isn’t the category to do that. No value tacking on to a help thread with such a statement. If you need technical assistance, please start a new thread. If you want simply want to recount your Wayland experience you could add to the existing Open Chat thread (or start your own)…