Commit 9fbfef94 authored by David Redondo's avatar David Redondo 🏎
Browse files

Do not hide osd before showing it

and quit the app in the process. Rename the method to make it clear
what happens.
parent fbaf8d9f
Pipeline #207055 passed with stage
in 2 minutes and 22 seconds
......@@ -32,13 +32,18 @@ OsdManager::OsdManager(QObject *parent)
m_cleanupTimer->setInterval(60000);
m_cleanupTimer->setSingleShot(true);
connect(m_cleanupTimer, &QTimer::timeout, this, [this]() {
hideOsd();
quit();
});
QDBusConnection::sessionBus().registerObject(QStringLiteral("/org/kde/kscreen/osdService"), this, QDBusConnection::ExportAdaptors);
QDBusConnection::sessionBus().registerService(QStringLiteral("org.kde.kscreen.osdService"));
}
void OsdManager::hideOsd()
{
quit();
}
void OsdManager::quit()
{
qDeleteAll(m_osds);
qApp->quit();
......@@ -51,7 +56,6 @@ OsdManager::~OsdManager()
OsdAction::Action OsdManager::showActionSelector()
{
setDelayedReply(true);
hideOsd();
connect(new KScreen::GetConfigOperation(), &KScreen::GetConfigOperation::finished, this, [this, message = message()](const KScreen::ConfigOperation *op) {
if (op->hasError()) {
......@@ -109,7 +113,7 @@ OsdAction::Action OsdManager::showActionSelector()
}
auto reply = message.createReply(action);
QDBusConnection::sessionBus().send(reply);
hideOsd();
quit();
});
}
......
......@@ -34,6 +34,7 @@ public Q_SLOTS:
OsdAction::Action showActionSelector();
private:
void quit();
void slotIdentifyOutputs(KScreen::ConfigOperation *op);
QMap<QString, KScreen::Osd *> m_osds;
QTimer *m_cleanupTimer;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment