[wayland] Break showing desktop from ShellClient::takeFocus

Logic similar to Client::takeFocus: if window is keep above or on
screen display do not break. Also if window belongs to the same
ClientConnection as a desktop window don't break.
This commit is contained in:
Martin Gräßlin 2015-06-23 11:08:28 +02:00
parent 4b8fabca40
commit 7e1e044948

View file

@ -420,6 +420,23 @@ const QKeySequence &ShellClient::shortcut() const
void ShellClient::takeFocus() void ShellClient::takeFocus()
{ {
setActive(true); setActive(true);
bool breakShowingDesktop = !keepAbove() && !isOnScreenDisplay();
if (breakShowingDesktop) {
// check that it doesn't belong to the desktop
const auto &clients = waylandServer()->clients();
for (auto c: clients) {
if (!belongsToSameApplication(c, false)) {
continue;
}
if (c->isDesktop()) {
breakShowingDesktop = false;
break;
}
}
}
if (breakShowingDesktop)
workspace()->setShowingDesktop(false);
} }
void ShellClient::updateWindowRules(Rules::Types selection) void ShellClient::updateWindowRules(Rules::Types selection)