Do not wait for timer if there are no open windows

If there were no open windows KWin would wait until the timer ran
out and return false signifying that some windows didnt close.
BUG:477573
FIXED-IN:6.0
This commit is contained in:
David Redondo 2023-11-28 09:05:33 +01:00
parent a705c172ab
commit ff76c8581d

View file

@ -446,6 +446,13 @@ bool SessionManager::closeWaylandWindows()
toplevelWindow->closeWindow();
}
}
if (m_pendingWindows.empty()) {
m_closingWindowsGuard.reset();
QDBusConnection::sessionBus().send(dbusMessage.createReply(true));
return true;
}
m_closeTimer.start(std::chrono::seconds(10));
m_closeTimer.setSingleShot(true);
connect(&m_closeTimer, &QTimer::timeout, m_closingWindowsGuard.get(), [this, dbusMessage] {