Use KWIN_DBUS_SERVICE_SUFFIX for multi-head service name wrangling
Adjust the KWIN_DBUS_SERVICE_SUFFIX env variable in a multi-head scenario instead of adjusting the "org.kde.kwin" DBus service which we actually don't use in 5.x any more. REVIEW: 122217
This commit is contained in:
parent
861e7a5739
commit
8cb78b7df6
4 changed files with 6 additions and 20 deletions
12
main.cpp
12
main.cpp
|
@ -298,18 +298,6 @@ void Application::processCommandLine(QCommandLineParser *parser)
|
|||
Application::setCrashCount(parser->value(s_crashesOption).toInt());
|
||||
}
|
||||
|
||||
void Application::registerDBusService()
|
||||
{
|
||||
QString appname;
|
||||
if (x11ScreenNumber() == 0)
|
||||
appname = QStringLiteral("org.kde.kwin");
|
||||
else
|
||||
appname.sprintf("org.kde.kwin-screen-%d", KWin::Application::x11ScreenNumber());
|
||||
|
||||
QDBusConnection::sessionBus().interface()->registerService(
|
||||
appname, QDBusConnectionInterface::DontQueueService);
|
||||
}
|
||||
|
||||
void Application::setupTranslator()
|
||||
{
|
||||
QTranslator *qtTranslator = new QTranslator(qApp);
|
||||
|
|
2
main.h
2
main.h
|
@ -82,8 +82,6 @@ public:
|
|||
void setupCommandLine(QCommandLineParser *parser);
|
||||
void processCommandLine(QCommandLineParser *parser);
|
||||
|
||||
void registerDBusService();
|
||||
|
||||
static void setCrashCount(int count);
|
||||
static bool wasCrash();
|
||||
|
||||
|
|
|
@ -270,8 +270,5 @@ KWIN_EXPORT int kdemain(int argc, char * argv[])
|
|||
|
||||
a.start();
|
||||
|
||||
// TODO: is this still needed?
|
||||
a.registerDBusService();
|
||||
|
||||
return a.exec();
|
||||
}
|
||||
|
|
|
@ -224,6 +224,12 @@ KWIN_EXPORT int kdemain(int argc, char * argv[])
|
|||
// acts exactly as previously
|
||||
if (i != KWin::Application::x11ScreenNumber() && fork() == 0) {
|
||||
KWin::Application::setX11ScreenNumber(i);
|
||||
QByteArray dBusSuffix = qgetenv("KWIN_DBUS_SERVICE_SUFFIX");
|
||||
if (!dBusSuffix.isNull()) {
|
||||
dBusSuffix.append(".");
|
||||
}
|
||||
dBusSuffix.append(QByteArrayLiteral("head-")).append(QByteArray::number(i));
|
||||
qputenv("KWIN_DBUS_SERVICE_SUFFIX", dBusSuffix);
|
||||
// Break here because we are the child process, we don't
|
||||
// want to fork() anymore
|
||||
break;
|
||||
|
@ -288,8 +294,5 @@ KWIN_EXPORT int kdemain(int argc, char * argv[])
|
|||
#endif
|
||||
KWin::SessionSaveDoneHelper helper;
|
||||
|
||||
// TODO: is this still needed?
|
||||
a.registerDBusService();
|
||||
|
||||
return a.exec();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue