Changeset View
Changeset View
Standalone View
Standalone View
shell/main.cpp
Show All 15 Lines | |||||
16 | * You should have received a copy of the GNU General Public License | 16 | * You should have received a copy of the GNU General Public License | ||
17 | * along with this program; if not, write to the Free Software | 17 | * along with this program; if not, write to the Free Software | ||
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
19 | */ | 19 | */ | ||
20 | 20 | | |||
21 | #include <QApplication> | 21 | #include <QApplication> | ||
22 | #include <QCommandLineParser> | 22 | #include <QCommandLineParser> | ||
23 | #include <QQuickWindow> | 23 | #include <QQuickWindow> | ||
24 | #include <QSessionManager> | | |||
25 | #include <QDebug> | 24 | #include <QDebug> | ||
26 | #include <QProcess> | 25 | #include <QProcess> | ||
27 | #include <QMessageBox> | 26 | #include <QMessageBox> | ||
28 | #include <QDBusConnection> | 27 | #include <QDBusConnection> | ||
29 | #include <QDBusMessage> | 28 | #include <QDBusMessage> | ||
30 | 29 | | |||
31 | #include <KAboutData> | 30 | #include <KAboutData> | ||
32 | #include <KQuickAddons/QtQuickSettings> | 31 | #include <KQuickAddons/QtQuickSettings> | ||
Show All 25 Lines | 50 | { | |||
58 | //we don't have fractional scaling on the client so don't hit most the remaining bugs and | 57 | //we don't have fractional scaling on the client so don't hit most the remaining bugs and | ||
59 | //even if we don't use Qt scaling the compositor will try to scale us anyway so we have no choice | 58 | //even if we don't use Qt scaling the compositor will try to scale us anyway so we have no choice | ||
60 | if (!qEnvironmentVariableIsSet("PLASMA_USE_QT_SCALING")) { | 59 | if (!qEnvironmentVariableIsSet("PLASMA_USE_QT_SCALING")) { | ||
61 | qunsetenv("QT_DEVICE_PIXEL_RATIO"); | 60 | qunsetenv("QT_DEVICE_PIXEL_RATIO"); | ||
62 | QCoreApplication::setAttribute(Qt::AA_DisableHighDpiScaling); | 61 | QCoreApplication::setAttribute(Qt::AA_DisableHighDpiScaling); | ||
63 | } else { | 62 | } else { | ||
64 | QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); | 63 | QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); | ||
65 | } | 64 | } | ||
65 | QCoreApplication::setAttribute(Qt::AA_DisableSessionManager); | ||||
66 | 66 | | |||
67 | QQuickWindow::setDefaultAlphaBuffer(true); | 67 | QQuickWindow::setDefaultAlphaBuffer(true); | ||
68 | 68 | | |||
69 | const bool qpaVariable = qEnvironmentVariableIsSet("QT_QPA_PLATFORM"); | 69 | const bool qpaVariable = qEnvironmentVariableIsSet("QT_QPA_PLATFORM"); | ||
70 | KWorkSpace::detectPlatform(argc, argv); | 70 | KWorkSpace::detectPlatform(argc, argv); | ||
71 | QApplication app(argc, argv); | 71 | QApplication app(argc, argv); | ||
72 | if (!qpaVariable) { | 72 | if (!qpaVariable) { | ||
73 | // don't leak the env variable to processes we start | 73 | // don't leak the env variable to processes we start | ||
▲ Show 20 Lines • Show All 60 Lines • ▼ Show 20 Line(s) | |||||
134 | #ifdef WITH_KUSERFEEDBACKCORE | 134 | #ifdef WITH_KUSERFEEDBACKCORE | ||
135 | cliOptions.addOption(feedbackOption); | 135 | cliOptions.addOption(feedbackOption); | ||
136 | #endif | 136 | #endif | ||
137 | 137 | | |||
138 | aboutData.setupCommandLine(&cliOptions); | 138 | aboutData.setupCommandLine(&cliOptions); | ||
139 | cliOptions.process(app); | 139 | cliOptions.process(app); | ||
140 | aboutData.processCommandLine(&cliOptions); | 140 | aboutData.processCommandLine(&cliOptions); | ||
141 | 141 | | |||
142 | QGuiApplication::setFallbackSessionManagementEnabled(false); | | |||
143 | | ||||
144 | auto disableSessionManagement = [](QSessionManager &sm) { | | |||
145 | sm.setRestartHint(QSessionManager::RestartNever); | | |||
146 | }; | | |||
147 | QObject::connect(&app, &QGuiApplication::commitDataRequest, disableSessionManagement); | | |||
148 | QObject::connect(&app, &QGuiApplication::saveStateRequest, disableSessionManagement); | | |||
149 | | ||||
150 | ShellCorona* corona = new ShellCorona(&app); | 142 | ShellCorona* corona = new ShellCorona(&app); | ||
151 | corona->setShell(cliOptions.value(shellPluginOption)); | 143 | corona->setShell(cliOptions.value(shellPluginOption)); | ||
152 | 144 | | |||
153 | #ifdef WITH_KUSERFEEDBACKCORE | 145 | #ifdef WITH_KUSERFEEDBACKCORE | ||
154 | if (cliOptions.isSet(feedbackOption)) { | 146 | if (cliOptions.isSet(feedbackOption)) { | ||
155 | QTextStream(stdout) << corona->feedbackProvider()->describeDataSources(); | 147 | QTextStream(stdout) << corona->feedbackProvider()->describeDataSources(); | ||
156 | return 0; | 148 | return 0; | ||
157 | } | 149 | } | ||
▲ Show 20 Lines • Show All 72 Lines • Show Last 20 Lines |