Changeset View
Changeset View
Standalone View
Standalone View
startkde/startplasma-waylandsession.cpp
- This file was added.
1 | /* This file is part of the KDE project | ||||
---|---|---|---|---|---|
2 | Copyright (C) 2019 Aleix Pol Gonzalez <aleixpol@kde.org> | ||||
3 | | ||||
4 | This library is free software; you can redistribute it and/or | ||||
5 | modify it under the terms of the GNU Library General Public | ||||
6 | License as published by the Free Software Foundation; either | ||||
7 | version 2 of the License, or (at your option) any later version. | ||||
8 | | ||||
9 | This library is distributed in the hope that it will be useful, | ||||
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||||
12 | Library General Public License for more details. | ||||
13 | | ||||
14 | You should have received a copy of the GNU Library General Public License | ||||
15 | along with this library; see the file COPYING.LIB. If not, write to | ||||
16 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | ||||
17 | Boston, MA 02110-1301, USA. | ||||
18 | */ | ||||
19 | | ||||
20 | #include "startplasma.h" | ||||
21 | | ||||
22 | int main(int /*argc*/, char** /*argv*/) | ||||
23 | { | ||||
24 | // Boot sequence: | ||||
25 | // | ||||
26 | // kdeinit is used to fork off processes which improves memory usage | ||||
27 | // and startup time. | ||||
28 | // | ||||
29 | // * kdeinit starts klauncher first. | ||||
30 | // * Then kded is started. kded is responsible for keeping the sycoca | ||||
31 | // database up to date. When an up to date database is present it goes | ||||
32 | // into the background and the startup continues. | ||||
33 | // * Then kdeinit starts kcminit. kcminit performs initialisation of | ||||
34 | // certain devices according to the user's settings | ||||
35 | // | ||||
36 | // * Then ksmserver is started which takes control of the rest of the startup sequence | ||||
37 | | ||||
38 | runStartupConfig(); | ||||
39 | | ||||
40 | setupFontDpi(); | ||||
41 | | ||||
42 | QScopedPointer<QProcess, KillBeforeDeleter> ksplash(setupKSplash()); | ||||
43 | qputenv("PLASMA_USE_QT_SCALING", "1"); | ||||
44 | | ||||
45 | out << "startplasma-waylandsession: Starting up..."; | ||||
46 | | ||||
47 | if (qEnvironmentVariableIsSet("DISPLAY")) { | ||||
48 | setupX11(); | ||||
49 | } else { | ||||
50 | qWarning() << "running kwin without Xwayland support"; | ||||
51 | } | ||||
52 | setupGSLib(); | ||||
53 | | ||||
54 | if (!syncDBusEnvironment()) { | ||||
55 | out << "Could not sync environment to dbus.\n"; | ||||
56 | return 2; | ||||
57 | } | ||||
58 | | ||||
59 | if (!startKDEInit()) | ||||
60 | return 3; | ||||
61 | | ||||
62 | if (!startKSMServer()) | ||||
63 | return 4; | ||||
64 | | ||||
65 | // Anything after here is logout | ||||
66 | // It is not called after shutdown/restart | ||||
67 | waitForKonqi(); | ||||
68 | out << "startplasma-waylandsession: Shutting down...\n"; | ||||
69 | | ||||
70 | runSync(QStringLiteral("kdeinit5_shutdown"), {}); | ||||
71 | | ||||
72 | cleanupX11(); | ||||
73 | out << "startplasma-waylandsession: Done.\n"; | ||||
74 | | ||||
75 | return 0; | ||||
76 | } |