From fc98cf31d3dfb7db260fec07d4addce8383654cf Mon Sep 17 00:00:00 2001 From: vasilito Date: Sat, 1 Aug 2026 05:35:33 +0300 Subject: [PATCH] kde/sddm: port to Qt6 + Wayland-only (fix greeter XCB + XAuth compile errors) Three fixes to build sddm on Redox (Wayland-only, Qt6): - KeyboardModel.cpp: guard the XcbKeyboardBackend include + its runtime branch with #ifndef __redox__ (platformName is never 'xcb' on Redox, but the dead branch still pulled in -> fatal error). Wayland backend kept. - XAuth.h: declare ~XAuth() (the recipe's XAuth.cpp defines it, but the header only declared the ctor -> 'definition of implicitly-declared destructor'). - wayland-patch.sh XAuth.cpp heredoc: add + includes and replace Qt5 qrand() with QRandomGenerator (removed in Qt6). --- local/recipes/kde/sddm/source/src/common/XAuth.h | 1 + .../recipes/kde/sddm/source/src/greeter/KeyboardModel.cpp | 7 ++++++- local/recipes/kde/sddm/wayland-patch.sh | 4 +++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/local/recipes/kde/sddm/source/src/common/XAuth.h b/local/recipes/kde/sddm/source/src/common/XAuth.h index ab142924c6..082dfc64d7 100644 --- a/local/recipes/kde/sddm/source/src/common/XAuth.h +++ b/local/recipes/kde/sddm/source/src/common/XAuth.h @@ -30,6 +30,7 @@ class XAuth { public: XAuth(); + ~XAuth(); QString authDirectory() const; void setAuthDirectory(const QString &path); diff --git a/local/recipes/kde/sddm/source/src/greeter/KeyboardModel.cpp b/local/recipes/kde/sddm/source/src/greeter/KeyboardModel.cpp index 6ebfefbdcc..b3d15811a9 100644 --- a/local/recipes/kde/sddm/source/src/greeter/KeyboardModel.cpp +++ b/local/recipes/kde/sddm/source/src/greeter/KeyboardModel.cpp @@ -23,7 +23,9 @@ #include "KeyboardModel.h" #include "KeyboardModel_p.h" #include "waylandkeyboardbackend.h" +#ifndef __redox__ #include "XcbKeyboardBackend.h" +#endif namespace SDDM { /**********************************************/ @@ -31,11 +33,14 @@ namespace SDDM { /**********************************************/ KeyboardModel::KeyboardModel() : d(new KeyboardModelPrivate) { +#ifndef __redox__ if (QGuiApplication::platformName() == QLatin1String("xcb")) { m_backend = new XcbKeyboardBackend(d); m_backend->init(); m_backend->connectEventsDispatcher(this); - } else if (QGuiApplication::platformName().contains(QLatin1String("wayland"))) { + } else +#endif + if (QGuiApplication::platformName().contains(QLatin1String("wayland"))) { m_backend = new WaylandKeyboardBackend(d); m_backend->init(); } diff --git a/local/recipes/kde/sddm/wayland-patch.sh b/local/recipes/kde/sddm/wayland-patch.sh index 0236e2d055..9a4e369e6d 100755 --- a/local/recipes/kde/sddm/wayland-patch.sh +++ b/local/recipes/kde/sddm/wayland-patch.sh @@ -123,6 +123,8 @@ if [ -f "$SRC/src/common/XAuth.cpp" ]; then #include #include +#include +#include #include #include @@ -209,7 +211,7 @@ bool XAuth::addCookie(const QString &display) { * implementation via the xcb / X11 system library. */ m_cookie = QByteArray(16, '\0'); for (int i = 0; i < m_cookie.size(); i++) { - m_cookie[i] = static_cast(qrand() & 0xFF); + m_cookie[i] = static_cast(QRandomGenerator::global()->generate() & 0xFF); } return true; }