Inform KSplash via DBus about kwin startup
KSplash for PW2 will use DBus for setting stages instead of xatoms, this ports kwin to send a DBus message to KSplash. REVIEW: 113524
This commit is contained in:
parent
865bcdce38
commit
2dc5aebcc2
1 changed files with 7 additions and 10 deletions
17
main.cpp
17
main.cpp
|
@ -253,16 +253,13 @@ void Application::start()
|
||||||
|
|
||||||
Xcb::sync(); // Trigger possible errors, there's still a chance to abort
|
Xcb::sync(); // Trigger possible errors, there's still a chance to abort
|
||||||
|
|
||||||
const QByteArray splashAtomName(QByteArrayLiteral("_KDE_SPLASH_PROGRESS"));
|
// Tell KSplash that KWin has started
|
||||||
ScopedCPointer<xcb_intern_atom_reply_t> splashAtom(xcb_intern_atom_reply(connection(),
|
QDBusMessage ksplashProgressMessage = QDBusMessage::createMethodCall(QStringLiteral("org.kde.KSplash"),
|
||||||
xcb_intern_atom_unchecked(connection(), false, splashAtomName.length(), splashAtomName.constData()), nullptr));
|
QStringLiteral("/KSplash"),
|
||||||
xcb_client_message_event_t e;
|
QStringLiteral("org.kde.KSplash"),
|
||||||
e.response_type = XCB_CLIENT_MESSAGE;
|
QStringLiteral("setStage"));
|
||||||
e.format = 8;
|
ksplashProgressMessage.setArguments(QList<QVariant>() << QStringLiteral("wm"));
|
||||||
e.window = rootWindow();
|
QDBusConnection::sessionBus().asyncCall(ksplashProgressMessage);
|
||||||
e.type = splashAtom->atom;
|
|
||||||
strcpy((char*)e.data.data8, "wm");
|
|
||||||
xcb_send_event(connection(), false, rootWindow(), XCB_EVENT_MASK_SUBSTRUCTURE_NOTIFY, (const char *)&e);
|
|
||||||
});
|
});
|
||||||
// we need to do an XSync here, otherwise the QPA might crash us later on
|
// we need to do an XSync here, otherwise the QPA might crash us later on
|
||||||
Xcb::sync();
|
Xcb::sync();
|
||||||
|
|
Loading…
Reference in a new issue