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.The kde team released version 6.5.1 today. Maybe it fixed this wayland-related problem.
--- 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)
But your screenshot shows that you loaded plasma-6.4, instead of plasma-6.5.
Anything to get Wayland stable and play well with KDE.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.
Now that is very strange... when I double-check the distinfo in /usr/ports/x11-wm/plasma6-kwin, it returns:But your screenshot shows that you loaded plasma-6.4, instead of plasma-6.5.
# 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
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.
yeah, that commit came right before all the recent patching activity that fixed the ConsoleKit2 bug...
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.Well, wow.
Now it's on to avoiding having to restart SDDM when the screen goes blank after 3-5 minutes of inactivity.
service sddm restart.
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.Folks, please test this patch for plasma6-kwin port:
![]()
fix kwin_wayland crash
fix kwin_wayland crash. GitHub Gist: instantly share code, notes, and snippets.gist.github.com
--- 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"
+
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.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 .
I don't know if it's possible to run into copyright-related issues by adding such a patch to the official ports tree.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" +
[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)