diff --git a/startkde/startplasma-wayland.cpp b/startkde/startplasma-wayland.cpp index 453c9c243..b7825597d 100644 --- a/startkde/startplasma-wayland.cpp +++ b/startkde/startplasma-wayland.cpp @@ -1,83 +1,79 @@ /* This file is part of the KDE project Copyright (C) 2019 Aleix Pol Gonzalez This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "startplasma.h" #include #include #include #include int main(int /*argc*/, char** /*argv*/) { if (!createStartupConfig()) return 1; - //Manually disable auto scaling because we are scaling above - //otherwise apps that manually opt in for high DPI get auto scaled by the developer AND manually scaled by us - qputenv("QT_AUTO_SCREEN_SCALE_FACTOR", "0"); - - setupCursor(); + setupCursor(true); { KSharedConfig::Ptr fonts = KSharedConfig::openConfig("kcmfonts"); KConfigGroup group(fonts, "General"); auto dpiSetting = group.readEntry("forceFontDPIWayland", 96); auto dpi = dpiSetting == 0 ? 96 : dpiSetting; qputenv("QT_WAYLAND_FORCE_DPI", QByteArray::number(dpi)); } // Query whether org.freedesktop.locale1 is available. If it is, try to // set XKB_DEFAULT_{MODEL,LAYOUT,VARIANT,OPTIONS} accordingly. if (QDBusConnection::systemBus().interface()->isServiceRegistered("org.freedesktop.locale1")) { auto queryAndSet = [](const QByteArray &var, const QByteArray & value) { QDBusInterface iface(QStringLiteral("org.freedesktop.locale1"), QStringLiteral("/org/freedesktop/locale1"), QStringLiteral("org.freedesktop.locale1"), QDBusConnection::systemBus()); QString r = iface.property(value).toString(); if (!r.isEmpty()) qputenv(var, r.toLatin1()); }; queryAndSet("X11MODEL", "org.freedesktop.locale1.X11Model"); queryAndSet("X11LAYOUT", "org.freedesktop.locale1.X11Layout"); queryAndSet("X11VARIANT", "org.freedesktop.locale1.X11Variant"); queryAndSet("X11OPTIONS", "org.freedesktop.locale1.X11Options"); } runEnvironmentScripts(); if (!qEnvironmentVariableIsSet("DBUS_SESSION_BUS_ADDRESS")) { out << "startplasmacompositor: Could not start D-Bus. Can you call qdbus?\n"; return 1; } setupPlasmaEnvironment(); qputenv("XDG_SESSION_TYPE", "wayland"); if (!syncDBusEnvironment()) { out << "Could not sync environment to dbus.\n"; return 1; } runSync(KWIN_WAYLAND_BIN_PATH, { "--xwayland", "--libinput", "--exit-with-session=" CMAKE_INSTALL_FULL_LIBEXECDIR "/startplasma-waylandsession" }); out << "startplasmacompositor: Shutting down...\n"; cleanupPlasmaEnvironment(); out << "startplasmacompositor: Done.\n"; return 0; } diff --git a/startkde/startplasma-waylandsession.cpp b/startkde/startplasma-waylandsession.cpp index 6b95b94af..dc29dd4a2 100644 --- a/startkde/startplasma-waylandsession.cpp +++ b/startkde/startplasma-waylandsession.cpp @@ -1,71 +1,76 @@ /* This file is part of the KDE project Copyright (C) 2019 Aleix Pol Gonzalez This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "startplasma.h" int main(int /*argc*/, char** /*argv*/) { // Boot sequence: // // kdeinit is used to fork off processes which improves memory usage // and startup time. // // * kdeinit starts klauncher first. // * Then kded is started. kded is responsible for keeping the sycoca // database up to date. When an up to date database is present it goes // into the background and the startup continues. // * Then kdeinit starts kcminit. kcminit performs initialisation of // certain devices according to the user's settings // // * Then ksmserver is started which takes control of the rest of the startup sequence runStartupConfig(); + setupFontDpi(); QScopedPointer ksplash(setupKSplash()); - qputenv("PLASMA_USE_QT_SCALING" ,"1"); + qputenv("PLASMA_USE_QT_SCALING", "1"); - setupX11(); - setupGSLib(); + qDebug() << "startplasma-waylandsession: Starting up... DISPLAY=" << qgetenv("DISPLAY"); - out << "startplasma: Starting up...\n"; + if (qEnvironmentVariableIsSet("DISPLAY")) { + setupX11(); + } else { + qWarning() << "running kwin without Xwayland support"; + } + setupGSLib(); if (!syncDBusEnvironment()) { out << "Could not sync environment to dbus.\n"; - return 1; + return 2; } if (!startKDEInit()) - return 1; + return 3; if (!startKSMServer()) - return 1; + return 4; // Anything after here is logout // It is not called after shutdown/restart waitForKonqi(); out << "startplasma-waylandsession: Shutting down...\n"; runSync("kdeinit5_shutdown", {}); cleanupX11(); out << "startplasma-waylandsession: Done.\n"; return 0; } diff --git a/startkde/startplasma-x11.cpp b/startkde/startplasma-x11.cpp index 56c772367..8940489df 100644 --- a/startkde/startplasma-x11.cpp +++ b/startkde/startplasma-x11.cpp @@ -1,123 +1,119 @@ /* This file is part of the KDE project Copyright (C) 2019 Aleix Pol Gonzalez This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "startplasma.h" #include #include #include #include void sighupHandler(int) { out << "GOT SIGHUP\n"; } int main(int /*argc*/, char** /*argv*/) { // When the X server dies we get a HUP signal from xinit. We must ignore it // because we still need to do some cleanup. signal(SIGHUP, sighupHandler); // Boot sequence: // // kdeinit is used to fork off processes which improves memory usage // and startup time. // // * kdeinit starts klauncher first. // * Then kded is started. kded is responsible for keeping the sycoca // database up to date. When an up to date database is present it goes // into the background and the startup continues. // * Then kdeinit starts kcminit. kcminit performs initialisation of // certain devices according to the user's settings // // * Then ksmserver is started which takes control of the rest of the startup sequence // Check if a Plasma session already is running and whether it's possible to connect to X switch (kCheckRunning()) { case NoX11: out << "$DISPLAY is not set or cannot connect to the X server.\n"; return 1; case PlasmaRunning: messageBox("Plasma seems to be already running on this display.\n"); return 1; case NoPlasmaRunning: break; } if (!createStartupConfig()) return 1; runStartupConfig(); //Do not sync any of this section with the wayland versions as there scale factors are //sent properly over wl_output { const auto screenScaleFactors = qgetenv("kdeglobals_kscreen_screenscalefactors"); if (!screenScaleFactors.isEmpty()) { qputenv("QT_SCREEN_SCALE_FACTORS", screenScaleFactors); if (screenScaleFactors == "2" || screenScaleFactors == "3") { qputenv("GDK_SCALE", screenScaleFactors); qputenv("GDK_DPI_SCALE", QByteArray::number(1/screenScaleFactors.toInt(), 'g', 3)); } } } - //Manually disable auto scaling because we are scaling above - //otherwise apps that manually opt in for high DPI get auto scaled by the developer AND manually scaled by us - qputenv("QT_AUTO_SCREEN_SCALE_FACTOR", "0"); - - setupCursor(); + setupCursor(false); setupFontDpi(); QScopedPointer ksplash(setupKSplash()); runEnvironmentScripts(); out << "startkde: Starting up...\n"; setupPlasmaEnvironment(); setupX11(); if (!syncDBusEnvironment()) { // Startup error messageBox("Could not sync environment to dbus.\n"); return 1; } if (!startKDEInit()) return 1; if (!startKSMServer()) return 1; // Anything after here is logout // It is not called after shutdown/restart waitForKonqi(); out << "startkde: Shutting down...\n"; runSync("kdeinit5_shutdown", {}); cleanupPlasmaEnvironment(); cleanupX11(); out << "startkde: Done.\n"; return 0; } diff --git a/startkde/startplasma.cpp b/startkde/startplasma.cpp index 151bdc0e6..df08a1a67 100644 --- a/startkde/startplasma.cpp +++ b/startkde/startplasma.cpp @@ -1,398 +1,409 @@ /* This file is part of the KDE project Copyright (C) 2019 Aleix Pol Gonzalez This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include #include #include #include #include #include #include #include "kstartupconfig/kstartupconfig.h" #include "startplasma.h" QTextStream out(stderr); void messageBox(const QString &text) { out << text; runSync("xmessage", {"-geometry", "500x100", text}); } QStringList allServices(const QLatin1String& prefix) { QDBusConnectionInterface *bus = QDBusConnection::sessionBus().interface(); const QStringList services = bus->registeredServiceNames(); QMap servicesWithAliases; for (const QString &serviceName : services) { QDBusReply reply = bus->serviceOwner(serviceName); QString owner = reply; if (owner.isEmpty()) owner = serviceName; servicesWithAliases[owner].append(serviceName); } QStringList names; for (auto it = servicesWithAliases.constBegin(); it != servicesWithAliases.constEnd(); ++it) { if (it.value().startsWith(prefix)) names << it.value(); } names.removeDuplicates(); names.sort(); return names; } int runSync(const QString& program, const QStringList &args, const QStringList &env) { QProcess p; p.setEnvironment(env); - p.start(program, args); -// qDebug() << "started..." << program << args; p.setProcessChannelMode(QProcess::ForwardedChannels); - p.waitForFinished(); + p.start(program, args); + qDebug() << "started..." << program << args; + p.waitForFinished(-1); return p.exitCode(); } void writeFile(const QString& path, const QByteArray& contents) { QFile f(path); if (!f.open(QIODevice::WriteOnly)) { out << "Could not write into " << f.fileName() <<".\n"; exit(1); } f.write(contents); } void sourceFiles(const QStringList &files) { QStringList filteredFiles; std::copy_if(files.begin(), files.end(), std::back_inserter(filteredFiles), [](const QString& i){ return QFileInfo(i).isReadable(); } ); if (filteredFiles.isEmpty()) return; - const QStringList args = QStringList(CMAKE_INSTALL_FULL_LIBEXECDIR "/plasma-sourceenv.sh") << filteredFiles; + filteredFiles.prepend(CMAKE_INSTALL_FULL_LIBEXECDIR "/plasma-sourceenv.sh"); QProcess p; - p.start("/bin/sh", args); - p.waitForFinished(); + p.start("/bin/sh", filteredFiles); + p.waitForFinished(-1); const auto fullEnv = p.readAllStandardOutput(); auto envs = fullEnv.split('\n'); + for (auto &env: envs) { - putenv(env.data()); + const int idx = env.indexOf('='); + if (Q_UNLIKELY(idx > 0)) + continue; + + qputenv(env.left(idx), env.mid(idx+1)); } } bool createStartupConfig() { const QString configDir = QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation); if (!QDir().mkpath(configDir)) out << "Could not create config directory XDG_CONFIG_HOME: " << configDir << '\n'; //This is basically setting defaults so we can use them with kStartupConfig() //TODO: see into passing them as an argument writeFile(configDir + "/startupconfigkeys", "kcminputrc Mouse cursorTheme 'breeze_cursors'\n" "kcminputrc Mouse cursorSize ''\n" "ksplashrc KSplash Theme Breeze\n" "ksplashrc KSplash Engine KSplashQML\n" "kdeglobals KScreen ScaleFactor ''\n" "kdeglobals KScreen ScreenScaleFactors ''\n" "kcmfonts General forceFontDPI 0\n" ); //preload the user's locale on first start const QString localeFile = configDir + "/plasma-localerc"; if (!QFile::exists(localeFile)) { writeFile(localeFile, QByteArray("[Formats]\n" "LANG=" +qgetenv("LANG")+ "\n")); } if (int code = kStartupConfig()) { messageBox("kStartupConfig() does not exist or fails. The error code is " + QByteArray::number(code) + ". Check your installation.\n"); return false; } return true; } void runStartupConfig() { const QString configDir = QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation); //export LC_* variables set by kcmshell5 formats into environment //so it can be picked up by QLocale and friends. sourceFiles({configDir + "/startupconfig", configDir + "/plasma-locale-settings.sh"}); } -void setupCursor() +void setupCursor(bool wayland) { const auto kcminputrc_mouse_cursorsize = qgetenv("kcminputrc_mouse_cursorsize"); const auto kcminputrc_mouse_cursortheme = qgetenv("kcminputrc_mouse_cursortheme"); if (!kcminputrc_mouse_cursortheme.isEmpty() || !kcminputrc_mouse_cursorsize.isEmpty()) { #ifdef XCURSOR_PATH QByteArray path(XCURSOR_PATH); path.replace("$XCURSOR_PATH", qgetenv("XCURSOR_PATH")); qputenv("XCURSOR_PATH", path); #endif } //TODO: consider linking directly - if (runSync("kapplymousetheme", { "kcminputrc_mouse_cursortheme", "kcminputrc_mouse_cursorsize" }) == 10) { + const int applyMouseStatus = wayland ? 0 : runSync("kapplymousetheme", { "kcminputrc_mouse_cursortheme", "kcminputrc_mouse_cursorsize" }); + if (applyMouseStatus == 10) { qputenv("XCURSOR_THEME", "breeze_cursors"); } else if (!kcminputrc_mouse_cursortheme.isEmpty()) { qputenv("XCURSOR_THEME", kcminputrc_mouse_cursortheme); } if (!kcminputrc_mouse_cursorsize.isEmpty()) { qputenv("XCURSOR_SIZE", kcminputrc_mouse_cursorsize); } } // Source scripts found in /plasma-workspace/env/*.sh // (where correspond to the system and user's configuration // directory. // // This is where you can define environment variables that will be available to // all KDE programs, so this is where you can run agents using e.g. eval `ssh-agent` // or eval `gpg-agent --daemon`. // Note: if you do that, you should also put "ssh-agent -k" as a shutdown script // // (see end of this file). // For anything else (that doesn't set env vars, or that needs a window manager), // better use the Autostart folder. void runEnvironmentScripts() { QStringList scripts; const auto locations = QStandardPaths::locateAll(QStandardPaths::GenericConfigLocation, QStringLiteral("plasma-workspace/env"), QStandardPaths::LocateDirectory); for (const QString & location : locations) { QDir dir(location); const auto dirScripts = dir.entryInfoList({QStringLiteral("*.sh")}); for (const auto script : dirScripts) { scripts << script.absoluteFilePath(); } } sourceFiles(scripts); // Make sure that the KDE prefix is first in XDG_DATA_DIRS and that it's set at all. // The spec allows XDG_DATA_DIRS to be not set, but X session startup scripts tend // to set it to a list of paths *not* including the KDE prefix if it's not /usr or // /usr/local. if (!qEnvironmentVariableIsSet("XDG_DATA_DIRS")) { qputenv("XDG_DATA_DIRS", KDE_INSTALL_FULL_DATAROOTDIR ":/usr/share:/usr/local/share"); } } // Mark that full KDE session is running (e.g. Konqueror preloading works only // with full KDE running). The KDE_FULL_SESSION property can be detected by // any X client connected to the same X session, even if not launched // directly from the KDE session but e.g. using "ssh -X", kdesu. $KDE_FULL_SESSION // however guarantees that the application is launched in the same environment // like the KDE session and that e.g. KDE utilities/libraries are available. // KDE_FULL_SESSION property is also only available since KDE 3.5.5. // The matching tests are: // For $KDE_FULL_SESSION: // if test -n "$KDE_FULL_SESSION"; then ... whatever // For KDE_FULL_SESSION property (on X11): // xprop -root | grep "^KDE_FULL_SESSION" >/dev/null 2>/dev/null // if test $? -eq 0; then ... whatever // // Additionally there is $KDE_SESSION_UID with the uid // of the user running the KDE session. It should be rarely needed (e.g. // after sudo to prevent desktop-wide functionality in the new user's kded). // // Since KDE4 there is also KDE_SESSION_VERSION, containing the major version number. // void setupPlasmaEnvironment() { + //Manually disable auto scaling because we are scaling above + //otherwise apps that manually opt in for high DPI get auto scaled by the developer AND manually scaled by us + qputenv("QT_AUTO_SCREEN_SCALE_FACTOR", "0"); + qputenv("KDE_FULL_SESSION", "true"); qputenv("KDE_SESSION_VERSION", "5"); qputenv("KDE_SESSION_UID", QByteArray::number(getuid())); qputenv("XDG_CURRENT_DESKTOP", "KDE"); } void setupX11() { // Set a left cursor instead of the standard X11 "X" cursor, since I've heard // from some users that they're confused and don't know what to do. This is // especially necessary on slow machines, where starting KDE takes one or two // minutes until anything appears on the screen. // // If the user has overwritten fonts, the cursor font may be different now // so don't move this up. runSync("xsetroot", {"-cursor_name", "left_ptr"}); runSync("xprop", {"-root", "-f", "KDE_FULL_SESSION", "8t", "-set", "KDE_FULL_SESSION", "true"}); runSync("xprop", {"-root", "-f", "KDE_SESSION_VERSION", "32c", "-set", "KDE_SESSION_VERSION", "5"}); } void cleanupX11() { runSync("xprop", { "-root", "-remove", "KDE_FULL_SESSION" }); runSync("xprop", { "-root", "-remove", "KDE_SESSION_VERSION" }); } // TODO: Check if Necessary void cleanupPlasmaEnvironment() { qunsetenv("KDE_FULL_SESSION"); qunsetenv("KDE_SESSION_VERSION"); qunsetenv("KDE_SESSION_UID"); } // kwin_wayland can possibly also start dbus-activated services which need env variables. // In that case, the update in startplasma might be too late. bool syncDBusEnvironment() { int exitCode; // At this point all environment variables are set, let's send it to the DBus session server to update the activation environment if (!QStandardPaths::findExecutable("dbus-update-activation-environment").isEmpty()) exitCode = runSync("dbus-update-activation-environment", { "--systemd", "--all" }); else exitCode = runSync(CMAKE_INSTALL_FULL_LIBEXECDIR "/ksyncdbusenv", {}); return exitCode == 0; } void setupFontDpi() { const auto kcmfonts_general_forcefontdpi = qgetenv("kcmfonts_general_forcefontdpi"); if (kcmfonts_general_forcefontdpi == "0") { return; } //TODO port to c++? const QByteArray input = "Xft.dpi: kcmfonts_general_forcefontdpi"; QProcess p; p.start("xrdb", { "-quiet", "-merge", "-nocpp" }); - p.write(input); // qDebug() << "started..." << program << args; p.setProcessChannelMode(QProcess::ForwardedChannels); - p.waitForFinished(); + p.write(input); + p.closeWriteChannel(); + p.waitForFinished(-1); } -static int dl; +static int dl = -1; QProcess* setupKSplash() { dl = qEnvironmentVariableIntValue("DESKTOP_LOCKED"); qunsetenv("DESKTOP_LOCKED"); // Don't want it in the environment QProcess* p = nullptr; if (dl) { const auto ksplashrc_ksplash_engine = qgetenv("ksplashrc_ksplash_engine"); // the splashscreen and progress indicator if (ksplashrc_ksplash_engine == "KSplashQML") { p = new QProcess; p->start("ksplashqml", {QString::fromUtf8(qgetenv("ksplashrc_ksplash_theme"))}); } } return p; } void setupGSLib() // Get Ghostscript to look into user's KDE fonts dir for additional Fontmap { const QByteArray usr_fdir = QFile::encodeName(QDir::home().absoluteFilePath(".fonts")); if (qEnvironmentVariableIsSet("GS_LIB")) { qputenv("GS_LIB", usr_fdir + ':' + qgetenv("GS_LIB")); } else { qputenv("GS_LIB", usr_fdir); } } bool startKDEInit() { // We set LD_BIND_NOW to increase the efficiency of kdeinit. // kdeinit unsets this variable before loading applications. const int exitCode = runSync(CMAKE_INSTALL_FULL_LIBEXECDIR_KF5 "/start_kdeinit_wrapper", { "--kded", "+kcminit_startup" }, { "LD_BIND_NOW=true" }); if (exitCode != 0) { messageBox("startkde: Could not start kdeinit5. Check your installation."); return false; } OrgKdeKSplashInterface iface("org.kde.KSplash", "/KSplash", QDBusConnection::sessionBus()); iface.setStage("kinit"); return true; } bool startKSMServer() { // finally, give the session control to the session manager // see kdebase/ksmserver for the description of the rest of the startup sequence // if the KDEWM environment variable has been set, then it will be used as KDE's // window manager instead of kwin. // if KDEWM is not set, ksmserver will ensure kwin is started. // kwrapper5 is used to reduce startup time and memory usage // kwrapper5 does not return useful error codes such as the exit code of ksmserver. // We only check for 255 which means that the ksmserver process could not be // started, any problems thereafter, e.g. ksmserver failing to initialize, // will remain undetected. // If the session should be locked from the start (locked autologin), // lock now and do the rest of the KDE startup underneath the locker. - QStringList ksmserverOptions; + QStringList ksmserverOptions = { CMAKE_INSTALL_FULL_BINDIR "/ksmserver" }; if (dl) { ksmserverOptions << "--lockscreen"; } const auto exitCode = runSync("kwrapper5", ksmserverOptions); if (exitCode == 255) { // Startup error messageBox("startkde: Could not start ksmserver. Check your installation.\n"); return false; } return true; } void waitForKonqi() { const auto cfg = KSharedConfig::openConfig("startkderc"); KConfigGroup grp(cfg, "WaitForDrKonqi"); bool wait_drkonqi = grp.readEntry("Enabled", true); if (wait_drkonqi) { // wait for remaining drkonqi instances with timeout (in seconds) const int wait_drkonqi_timeout = grp.readEntry("Timeout", 900) * 1000; QElapsedTimer wait_drkonqi_counter; wait_drkonqi_counter.start(); QStringList services = allServices(QLatin1String("org.kde.drkonqi-")); while (!services.isEmpty()) { sleep(5); services = allServices(QLatin1String("org.kde.drkonqi-")); if (wait_drkonqi_counter.elapsed() >= wait_drkonqi_timeout) { // ask remaining drkonqis to die in a graceful way for (const auto &service: services) { QDBusInterface iface(service, "/MainApplication"); iface.call("quit"); } break; } } } } diff --git a/startkde/startplasma.h b/startkde/startplasma.h index eecb44a00..2264da27f 100644 --- a/startkde/startplasma.h +++ b/startkde/startplasma.h @@ -1,64 +1,64 @@ /* This file is part of the KDE project Copyright (C) 2019 Aleix Pol Gonzalez This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef STARTPLASMA_H #define STARTPLASMA_H #include "kcheckrunning/kcheckrunning.h" #include "kstartupconfig/kstartupconfig.h" #include #include "config-startplasma.h" extern QTextStream out; QStringList allServices(const QLatin1String& prefix); int runSync(const QString& program, const QStringList &args, const QStringList &env = {}); void writeFile(const QString& path, const QByteArray& contents); void sourceFiles(const QStringList &files); void messageBox(const QString &text); bool createStartupConfig(); void runStartupConfig(); -void setupCursor(); +void setupCursor(bool wayland); void runEnvironmentScripts(); void setupPlasmaEnvironment(); void cleanupPlasmaEnvironment(); void cleanupX11(); bool syncDBusEnvironment(); void setupFontDpi(); QProcess* setupKSplash(); void setupGSLib(); void setupX11(); bool startKDEInit(); bool startKSMServer(); void waitForKonqi(); struct KillBeforeDeleter { static inline void cleanup(QProcess *pointer) { if (pointer) pointer->kill(); delete pointer; } }; #endif