Trying to run KDE 6 Plasma with Wayland....

With Plasma 6.5.0, that is unfortunate, seems to be a breaking update that breaks the hard work done as documented in this thread. Last known version to work with Wayland was 6.4.5. That is still in official Ports repo at the moment.

If I could, I'd freeze that while allowing everything else to be upgraded. Unfortunately, it looks to be a massive undertaking that will need to be conducted outside of the 'official' areas whose URLs are published to rank-and-file users.

I plan to install a few other Wayland compositors just to see and confirm for myself if they work. If they do - it would be pretty galling to see, especially against the backdrop of a major player like Plasma having a spectacular failure.

And it would be another round of learning troubleshooting techniques, capturing logs, and posting them... It's not a trivial task to learn all that, connect the dots where they need to be connected, have a sense for what's relevant, what's not, and to put that knowledge to good use. That was done for Xorg on FreeBSD back in the day. The way I see it, it probably needs to be done for Wayland today - if somebody has the motivation and ability/brains to do the heavy lifting. 😩
 
The kde team released version 6.5.1 today. Maybe it fixed this wayland-related problem.
Well, it does take skills of someone like makc_ to work an upstream release into Ports correctly... If I see that this bugfix release made its way into somebody's Area 51 repo, I'd be happy to download it, compile it, and test it.

As things stand now on my end of things - it would just take me too long to learn the ropes of tracking upstream KDE releases and set my metal up correctly for THAT.
 
Ha! You guys didn't tell me one basic fact: under CK2, attempting to load Plasma 6.5 as a Wayland server results in a crash that generates kwin_wayland.core! My buddy ChatGPT immediately gave me a patch that fixes this crash. patch-src_backends_libinput_device.cpp has to be placed in x11-wm/plasma6-kwin/files of the area51 branch. It contains this code:
C++:
--- src/backends/libinput/device.cpp.orig    2025-10-16 11:33:48 UTC
+++ src/backends/libinput/device.cpp
@@ -326,8 +326,38 @@ bool setOrientedCalibrationMatrix(libinput_device *dev
     float data[6]{matrix(0, 0), matrix(0, 1), matrix(0, 2), matrix(1, 0), matrix(1, 1), matrix(1, 2)};
     return libinput_device_config_calibration_set_matrix(device, data) == LIBINPUT_CONFIG_STATUS_SUCCESS;
 }
+
+// --- Helpers to safely query udev on non-Linux systems (e.g. libudev-devd) ---
+const char *safeUdevSyspath(libinput_device *device)
+{
+    if (!device) {
+        return nullptr;
+    }
+    udev_device *udev = libinput_device_get_udev_device(device);
+    if (!udev) {
+        return nullptr;
+    }
+    const char *path = udev_device_get_syspath(udev);
+    udev_device_unref(udev);
+    return path; // may be nullptr
 }
 
+bool safeHasTouchpadProperty(libinput_device *device)
+{
+    if (!device) {
+        return false;
+    }
+    udev_device *udev = libinput_device_get_udev_device(device);
+    if (!udev) {
+        return false;
+    }
+    const char *val = udev_device_get_property_value(udev, "ID_INPUT_TOUCHPAD");
+    bool has = val != nullptr;
+    udev_device_unref(udev);
+    return has;
+}
+} // namespace
+
 Device::Device(libinput_device *device, QObject *parent)
     : InputDevice(parent)
     , m_device(device)
@@ -340,10 +370,10 @@ Device::Device(libinput_device *device, QObject *paren
     , m_switch(libinput_device_has_capability(m_device, LIBINPUT_DEVICE_CAP_SWITCH))
     , m_lidSwitch(m_switch ? libinput_device_switch_has_switch(m_device, LIBINPUT_SWITCH_LID) : false)
     , m_tabletSwitch(m_switch ? libinput_device_switch_has_switch(m_device, LIBINPUT_SWITCH_TABLET_MODE) : false)
-    , m_touchpad(m_pointer && udev_device_get_property_value(libinput_device_get_udev_device(m_device), "ID_INPUT_TOUCHPAD"))
+    , m_touchpad(m_pointer && safeHasTouchpadProperty(m_device))
     , m_name(QString::fromLocal8Bit(libinput_device_get_name(m_device)))
     , m_sysName(QString::fromLocal8Bit(libinput_device_get_sysname(m_device)))
-    , m_sysPath(QString::fromLocal8Bit(udev_device_get_syspath(libinput_device_get_udev_device(m_device))))
+    , m_sysPath(QString::fromLocal8Bit(safeUdevSyspath(m_device)))
     , m_outputName(QString::fromLocal8Bit(libinput_device_get_output_name(m_device)))
     , m_product(libinput_device_get_id_product(m_device))
     , m_vendor(libinput_device_get_id_vendor(m_device))
@@ -468,7 +498,7 @@ Device::Device(libinput_device *device, QObject *paren
         const auto devPath = udev_device_get_devpath(udevDevice);
 
         // In UDev, all virtual uinput devices have a devpath start with /devices/virtual
-        m_isVirtual = strstr(devPath, "/devices/virtual/") != nullptr;
+        m_isVirtual = (devPath && strstr(devPath, "/devices/virtual/") != nullptr);
         udev_device_unref(udevDevice);
     }
 
@@ -750,7 +780,7 @@ CONFIG(setTapToClick, m_tapFingerCount == 0, tap_set_e
 
 CONFIG(setDisableWhileTyping, !m_supportsDisableWhileTyping, dwt_set_enabled, DWT, disableWhileTyping, DisableWhileTyping)
 CONFIG(setTapToClick, m_tapFingerCount == 0, tap_set_enabled, TAP, tapToClick, TapToClick)
-CONFIG(setTapAndDrag, false, tap_set_drag_enabled, DRAG, tapAndDrag, TapAndDrag)
+CONFIG(setTapAndDrag, false, tap_set_drag_enabled, DRAG, tapAndDrag, TapDragLock)
 CONFIG(setTapDragLock, false, tap_set_drag_lock_enabled, DRAG_LOCK, tapDragLock, TapDragLock)
 CONFIG(setMiddleEmulation, m_supportsMiddleEmulation == false, middle_emulation_set_enabled, MIDDLE_EMULATION, middleEmulation, MiddleButtonEmulation)
Now I can load CK2/Plasma-6.5 on Wayland.
 
Last edited:
😲

Wow.

This is not something that I'd think of under my own steam. This is much appreciated, Oleg_NYC ! I seriously did not see this coming.

I still have a LONG way to go before I can connect the dots like that.

That's what it means to have actual, real programming talent, bud.

Now I'm off to test that patch on my end of things! 😁

Edit: All of the logs that I attached earlier in this thread (out_a.txt, etc) document the crash. :P
 
Yep, that patch fixes it, and keyboard/mouse work, too! Maybe we should let makc_ know, too.

👏🎉

Welp, this was the very first launch of systemsettings... that's why it shows incorrect info. Subsequent launches show correct info. 😅
 

Attachments

  • Screenshot_20250621_152835.png
    Screenshot_20250621_152835.png
    119.5 KB · Views: 30
Maybe wrong PR is pointed on commit, but this possibly helps.
Not sure from what version of LinuxKPI is affected and to what range of branches it could be MFC'ed.
Anything to get Wayland stable and play well with KDE.

Especially considering that I left the computer alone for less than 5 minutes, screen turns off, and wiggling the mouse / mashing the keyboard does NOT help, screen stays off.

Edit: Fortunately, it's easy to just SSH in from the side and restart the SDDM service, that puts things back in order.
 
But your screenshot shows that you loaded plasma-6.4, instead of plasma-6.5.
Now that is very strange... when I double-check the distinfo in /usr/ports/x11-wm/plasma6-kwin, it returns:
Code:
# cat distinfo
TIMESTAMP = 1761168017
SHA256 (KDE/plasma/6.5.0/kwin-6.5.0.tar.xz) = e0eaa67980266fe27fe32d15c9f18f8206776919f81d4e1a889d34c5f65cf982
SIZE (KDE/plasma/6.5.0/kwin-6.5.0.tar.xz) = 8787556

I know I comiled in the correct directory, and applied the patch - the CK2 crash is definitely fixed.

That's what it means to be thorough in testing.
 
Well, on second launch, I get the correct info:

Must've been some incorrect info in a cache...
 

Attachments

  • Screenshot_plasma_wayland_2.png
    Screenshot_plasma_wayland_2.png
    100.6 KB · Views: 22
Well, wow.

Now it's on to avoiding having to restart SDDM when the screen goes blank after 3-5 minutes of inactivity.
 
Well, wow.

Now it's on to avoiding having to restart SDDM when the screen goes blank after 3-5 minutes of inactivity.
Turns out that I can't let my installation sleep - The sleep function is so messed up on FreeBSD that I decided to never let the machine actually sleep - turning off the screen after 5 or 10 or 15 minutes is marginally OK. That sleep problem was never properly resolved on Xorg, either.

Trouble is, with Xorg, I can wiggle the mouse or mash the keyboard - and I get back to the SDDM screen. On Wayland, the screen stays off, and I have to SSH in from the side (this is exactly why I can't let the machine sleep!), and restard SDDM (as root) with service sddm restart.

One positive observation from that is that my Wayland session stays alive after that SDDM restart, programs stay open, and I have peace of mind that whatever I typed into Kate (and did not save) is not gone, it's still there. (Edit: That is a bit unpredictable. I did have Dolphin disappear on me without a trace, not even a core dump.)

I can try and see if the issue gets reproduced with LightDM (which I do have working this time around)...

For now, I'm attaching a screenshot of power management settings that I currently have...

Oh, and one more thing: Logs seem to show that SDDM crashes when the screen turns off... HDMI connection gets lost, too. Logs captured and attached as sddm_crash.txt
 

Attachments

  • power_management.png
    power_management.png
    106 KB · Views: 22
  • sddm_crash.txt
    sddm_crash.txt
    4.7 KB · Views: 18
Folks, please test this patch for plasma6-kwin port:
This does conflict with the patch that Oleg_NYC posted yesterday to this thread. I had to move his patch outside of the /usr/ports/x11-wm/plasma6-kwin/files/ to make the patch provided by makc_ cooperate with the (re)compilation of the port.

Right now, my screen locks after 5 minutes, and gets turned off a minute later (which is actually the default settings in Plasma). But nope, no sleeping allowed.

aaand, nope. The patch provided by makc_ does NOT work - I get a blank screen, and SDDM crashes. The patch provided by Oleg_NYC works - I get back into my Plasma Wayland session.

SDDM still needs to be restarted by hand. But with makc_ 's patch, I also lose mouse and keyboard, so no input after I ssh in and restart SDDM that way.
 
Update: LightDM (x11/lightdm) allows me to log into the Plasma Wayland session that has x11-wm/plasma-kwin6 as patched by makc_ just now - that is different from SDDM.

BUT - I don't have keyboard/mouse input in that scenario.

I had to revert to Oleg_NYC 's patch. But even then, LightDM is not making a difference, I still don't get keyboard/mouse. Moving back to SDDM - which works, I get keyboard/mouse back.

Edit: Seems like SDDM crashes when HDMI signal is lost (upon display being turned off). I could test that with DisplayPort and see if that makes a difference. I don't have an available laptop handy at this time to test this very quickly.
 
By the way, makc_ , as you are aware, Plasma Wayland has the GUI-disappearing problem that occurs when you start hopping between TTYs and then return to Plasma's TTY. A few weeks ago, ChatGPT generated a patch for me that allowed me to get rid of this problem, though it's possible the patch has bugs that I am not aware of. (I can say the same thing about the libinput patch ChatGPT generated for me). Please take a look at the patch and tell me if this code can be added to the official ports tree (x11-wm/plasma6-kwin/files). It's patch-src_backends_drm_drm__backend.cpp .
C++:
--- src/backends/drm/drm_backend.cpp.orig    2025-08-05 10:50:46 UTC
+++ src/backends/drm/drm_backend.cpp
@@ -12,6 +12,7 @@
 
 #include "backends/libinput/libinputbackend.h"
 #include "core/outputconfiguration.h"
+#include "core/renderloop.h"
 #include "core/session.h"
 #include "drm_egl_backend.h"
 #include "drm_gpu.h"
@@ -24,7 +25,7 @@
 #include "drm_virtual_output.h"
 #include "utils/envvar.h"
 #include "utils/udev.h"
-// KF5
+// KF
 #include <KCoreAddons>
 #include <KLocalizedString>
 // Qt
@@ -116,6 +117,25 @@ bool DrmBackend::initialize()
         }
     });
 
+    // NEW: gate udev events while inactive and kick a repaint after re‑enable.
+    connect(m_session, &Session::activeChanged, this, [this](bool active) {
+        if (m_socketNotifier) {
+            m_socketNotifier->setEnabled(active);
+        }
+        for (auto &gpu : m_gpus) {
+            gpu->setActive(active);
+        }
+        if (active) {
+            // Update outputs and ensure we push a frame → full modeset if needed.
+            updateOutputs();
+            for (auto *o : std::as_const(m_outputs)) {
+                if (o->renderLoop()) {
+                    o->renderLoop()->scheduleRepaint();
+                }
+            }
+        }
+    });
+
     if (!m_explicitGpus.isEmpty()) {
         for (const QString &fileName : m_explicitGpus) {
             addGpu(fileName);
@@ -140,6 +160,7 @@ bool DrmBackend::initialize()
         const int fd = m_udevMonitor->fd();
         if (fd != -1) {
             m_socketNotifier = std::make_unique<QSocketNotifier>(fd, QSocketNotifier::Read);
+            // Note: enabled/disabled dynamically in activeChanged handler above.
             connect(m_socketNotifier.get(), &QSocketNotifier::activated, this, &DrmBackend::handleUdevEvent);
             m_udevMonitor->enable();
         }
@@ -488,6 +509,8 @@ EglDisplay *DrmBackend::sceneEglDisplayObject() const
 {
     return m_gpus.front()->eglDisplay();
 }
-}
 
+} // namespace KWin
+
 #include "moc_drm_backend.cpp"
+
I don't know if it's possible to run into copyright-related issues by adding such a patch to the official ports tree.
 
By the way, makc_ , as you are aware, Plasma Wayland has the GUI-disappearing problem that occurs when you start hopping between TTYs and then return to Plasma's TTY. A few weeks ago, ChatGPT generated a patch for me that allowed me to get rid of this problem, though it's possible the patch has bugs that I am not aware of. (I can say the same thing about the libinput patch ChatGPT generated for me). Please take a look at the patch and tell me if this code can be added to the official ports tree (x11-wm/plasma6-kwin/files). It's patch-src_backends_drm_drm__backend.cpp .
C++:
--- src/backends/drm/drm_backend.cpp.orig    2025-08-05 10:50:46 UTC
+++ src/backends/drm/drm_backend.cpp
@@ -12,6 +12,7 @@
 
 #include "backends/libinput/libinputbackend.h"
 #include "core/outputconfiguration.h"
+#include "core/renderloop.h"
 #include "core/session.h"
 #include "drm_egl_backend.h"
 #include "drm_gpu.h"
@@ -24,7 +25,7 @@
 #include "drm_virtual_output.h"
 #include "utils/envvar.h"
 #include "utils/udev.h"
-// KF5
+// KF
 #include <KCoreAddons>
 #include <KLocalizedString>
 // Qt
@@ -116,6 +117,25 @@ bool DrmBackend::initialize()
         }
     });
 
+    // NEW: gate udev events while inactive and kick a repaint after re‑enable.
+    connect(m_session, &Session::activeChanged, this, [this](bool active) {
+        if (m_socketNotifier) {
+            m_socketNotifier->setEnabled(active);
+        }
+        for (auto &gpu : m_gpus) {
+            gpu->setActive(active);
+        }
+        if (active) {
+            // Update outputs and ensure we push a frame → full modeset if needed.
+            updateOutputs();
+            for (auto *o : std::as_const(m_outputs)) {
+                if (o->renderLoop()) {
+                    o->renderLoop()->scheduleRepaint();
+                }
+            }
+        }
+    });
+
     if (!m_explicitGpus.isEmpty()) {
         for (const QString &fileName : m_explicitGpus) {
             addGpu(fileName);
@@ -140,6 +160,7 @@ bool DrmBackend::initialize()
         const int fd = m_udevMonitor->fd();
         if (fd != -1) {
             m_socketNotifier = std::make_unique<QSocketNotifier>(fd, QSocketNotifier::Read);
+            // Note: enabled/disabled dynamically in activeChanged handler above.
             connect(m_socketNotifier.get(), &QSocketNotifier::activated, this, &DrmBackend::handleUdevEvent);
             m_udevMonitor->enable();
         }
@@ -488,6 +509,8 @@ EglDisplay *DrmBackend::sceneEglDisplayObject() const
 {
     return m_gpus.front()->eglDisplay();
 }
-}
 
+} // namespace KWin
+
 #include "moc_drm_backend.cpp"
+
I don't know if it's possible to run into copyright-related issues by adding such a patch to the official ports tree.
Now this is a different patch than the one you submitted yesterday! And I'm under impression that it needs to be tested (to see if it works for me) and included, as well. Right now, I'm in the middle of playing with cables, to test my theory of HDMI signal loss crashing SDDM. Hopefully I'm wrong about that, but I have seen cases where a different type of cable made a difference for the display.
 
Well, damn... DisplayPort did make a difference over HDMI.

I stepped away from the screen for lunch, and returned to a powered-down screen.

Wiggling the mouse and mashing the keyboard did get me back to the lockscreen, and screen powered back on - that is different from HDMI.

Unfortunately, after that, I lost the keyboard/mouse input. Seems like I need to SSH in from the side and restart SDDM... sigh.

And... that works to the extend that I do get keyboard and mouse back, but the session is not retained - if I have Kate with unsaved stuff typed in it, that is gone. And same will happen with Dolphin and Konsole. And they are gone without a trace, not even a core dump.

Yeah, this is a showstopper.

Time to see if Oleg_NYC 's latest patch in this thread solves the problem for me... 😩
 
x11-wm/plasma6-kwin recompiled and re-installed with Oleg_NYC 's patch from post #672.

It did not make a difference - I still have the same outcomes as before applying the patch.

But looking at some log entries generated by SDDM, I am beginning to think that it crashes the moment I push the enter key (after typing in my password). Below is a log snippet that I think is relevant:
Code:
[14:51:06.190] (II) HELPER: Starting Wayland user session: "/usr/local/share/sddm/scripts/wayland-session" "ck-launch-session /usr/local/lib/libexec/plasma-dbus-run-session-if-needed /usr/local/bin/startplasma-wayland"
[14:51:06.504] (II) DAEMON: Session started true
[14:51:11.758] (II) DAEMON: Greeter stopping...
[14:51:11.758] (WW) HELPER: Signal received: SIGTERM
[14:51:16.760] (WW) DAEMON: Error from greeter session: "Process crashed"
[14:51:16.760] (WW) DAEMON: Auth: sddm-helper (--socket /tmp/sddm-auth-6ea67b91-cdff-412a-8f25-70df57771930 --id 2 --start /usr/local/bin/sddm-greeter-qt6 --socket /tmp/sddm-:0-skxemW --theme /usr/local/share/sddm/themes/breeze --user sddm --greeter) crashed (exit code 1)
[14:51:16.760] (WW) DAEMON: Error from greeter session: "Process crashed"
[14:51:16.760] (WW) DAEMON: Auth: sddm-helper exited with 9
[14:51:16.760] (II) DAEMON: Greeter stopped. SDDM::Auth::HelperExitStatus(9)

I see this code even when I have a successful login into a Plasma Wayland session.... SDDM collapses while I have crossed over into a Plasma Wayland session, unaware that the proverbial bridge called SDDM collapsed behind me.
 
Back
Top