From 7e1e044948ba70bd6521dbc5b782d8bbbe67cd68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Tue, 23 Jun 2015 11:08:28 +0200 Subject: [PATCH] [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. --- shell_client.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/shell_client.cpp b/shell_client.cpp index 633215403b..df7d46a057 100644 --- a/shell_client.cpp +++ b/shell_client.cpp @@ -420,6 +420,23 @@ const QKeySequence &ShellClient::shortcut() const void ShellClient::takeFocus() { 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)