kde/sddm: port to Qt6 + Wayland-only (fix greeter XCB + XAuth compile errors)
redbear-ci / check (push) Has been cancelled

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 <xcb/xkb.h> -> 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 <QFileInfo> + <QRandomGenerator>
   includes and replace Qt5 qrand() with QRandomGenerator (removed in Qt6).
This commit is contained in:
2026-08-01 05:35:33 +03:00
parent 5e7fadb9ca
commit fc98cf31d3
3 changed files with 10 additions and 2 deletions
@@ -30,6 +30,7 @@ class XAuth
{
public:
XAuth();
~XAuth();
QString authDirectory() const;
void setAuthDirectory(const QString &path);
@@ -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();
}
+3 -1
View File
@@ -123,6 +123,8 @@ if [ -f "$SRC/src/common/XAuth.cpp" ]; then
#include <QDebug>
#include <QFile>
#include <QFileInfo>
#include <QRandomGenerator>
#include <QStandardPaths>
#include <fcntl.h>
@@ -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<char>(qrand() & 0xFF);
m_cookie[i] = static_cast<char>(QRandomGenerator::global()->generate() & 0xFF);
}
return true;
}