Advance KDE, Qt, and Wayland recipe sources

This commit is contained in:
2026-04-20 18:37:35 +01:00
parent f3e6b09811
commit 4275949ede
36 changed files with 281 additions and 443 deletions
@@ -22,6 +22,9 @@ namespace KWin
static std::unique_ptr<DrmDevice> findRenderDevice()
{
#ifdef Q_OS_REDOX
return nullptr;
#endif
const int deviceCount = drmGetDevices2(0, nullptr, 0);
if (deviceCount <= 0) {
return nullptr;
@@ -24,6 +24,9 @@ static const struct
std::unique_ptr<Session> Session::create()
{
#ifdef Q_OS_REDOX
return NoopSession::create();
#else
for (const auto &sessionInfo : s_availableSessions) {
std::unique_ptr<Session> session = sessionInfo.createFunc();
if (session) {
@@ -31,15 +34,27 @@ std::unique_ptr<Session> Session::create()
}
}
return nullptr;
#endif
}
std::unique_ptr<Session> Session::create(Type type)
{
#ifdef Q_OS_REDOX
switch (type) {
case Type::Logind:
return NoopSession::create();
case Type::ConsoleKit:
return ConsoleKitSession::create();
case Type::Noop:
return NoopSession::create();
}
#else
for (const auto &sessionInfo : s_availableSessions) {
if (sessionInfo.type == type) {
return sessionInfo.createFunc();
}
}
#endif
return nullptr;
}
@@ -108,7 +108,19 @@ static bool activate(const QString &sessionPath)
std::unique_ptr<LogindSession> LogindSession::create()
{
if (!QDBusConnection::systemBus().interface()->isServiceRegistered(s_serviceName)) {
const QDBusConnection systemBus = QDBusConnection::systemBus();
if (!systemBus.isConnected()) {
qCWarning(KWIN_CORE) << "Could not connect to the system D-Bus";
return nullptr;
}
QDBusConnectionInterface *busInterface = systemBus.interface();
if (!busInterface) {
qCWarning(KWIN_CORE) << "Could not acquire the system D-Bus interface";
return nullptr;
}
if (!busInterface->isServiceRegistered(s_serviceName)) {
return nullptr;
}
@@ -6,6 +6,9 @@
#include "session_noop.h"
#include <fcntl.h>
#include <unistd.h>
namespace KWin
{
@@ -40,11 +43,18 @@ uint NoopSession::terminal() const
int NoopSession::openRestricted(const QString &fileName)
{
return -1;
int fd = open(fileName.toUtf8().constData(), O_RDWR | O_CLOEXEC);
if (fd >= 0) {
return fd;
}
return open(fileName.toUtf8().constData(), O_RDONLY | O_CLOEXEC);
}
void NoopSession::closeRestricted(int fileDescriptor)
{
if (fileDescriptor >= 0) {
close(fileDescriptor);
}
}
void NoopSession::switchTo(uint terminal)
@@ -27,9 +27,12 @@
#include <QDebug>
#include <QProcess>
#include <QTemporaryFile>
#include <QTimer>
#include <KSignalHandler>
#ifndef Q_OS_REDOX
#include <KUpdateLaunchEnvironmentJob>
#endif
#include <signal.h>
@@ -148,7 +151,9 @@ void KWinWrapper::run()
}
qputenv("KWIN_RESTART_COUNT", QByteArray::number(m_crashCount));
// restart
m_kwinProcess->start();
QTimer::singleShot(0, this, [this]() {
m_kwinProcess->start();
});
});
m_kwinProcess->start();
@@ -163,11 +168,15 @@ void KWinWrapper::run()
}
}
#endif
#ifdef Q_OS_REDOX
Q_UNUSED(env)
#else
auto envSyncJob = new KUpdateLaunchEnvironmentJob(env);
connect(envSyncJob, &KUpdateLaunchEnvironmentJob::finished, this, []() {
// The service name is merely there to indicate to the world that we're up and ready with all envs exported
QDBusConnection::sessionBus().registerService(QStringLiteral("org.kde.KWinWrapper"));
});
#endif
}
void KWinWrapper::terminate(std::chrono::milliseconds timeout)
@@ -194,12 +203,15 @@ int main(int argc, char **argv)
QCoreApplication app(argc, argv);
app.setQuitLockEnabled(false); // don't exit when the first KJob finishes
#ifndef Q_OS_REDOX
KSignalHandler::self()->watchSignal(SIGTERM);
KSignalHandler::self()->watchSignal(SIGHUP);
#endif
KWinWrapper wrapper(&app);
wrapper.run();
#ifndef Q_OS_REDOX
QObject::connect(KSignalHandler::self(), &KSignalHandler::signalReceived, &app, [&app, &wrapper](int signal) {
if (signal == SIGTERM) {
app.quit();
@@ -207,6 +219,7 @@ int main(int argc, char **argv)
wrapper.restart();
}
});
#endif
return app.exec();
}
@@ -17,6 +17,7 @@
#include "compositor_wayland.h"
#include "core/outputbackend.h"
#include "core/session.h"
#include "core/session_noop.h"
#include "effect/effecthandler.h"
#include "inputmethod.h"
#include "tabletmodemanager.h"
@@ -431,7 +432,6 @@ int main(int argc, char *argv[])
};
BackendType backendType;
QString pluginName;
QSize initialWindowSize;
int outputCount = 1;
qreal outputScale = 1;