From 81cdfd2ebfa0778071f70cf8c937176215ace383 Mon Sep 17 00:00:00 2001 From: Vlad Zagorodniy Date: Fri, 10 May 2019 10:47:05 +0300 Subject: [PATCH] Keep internal clients in the unmanaged layer Summary: All internal clients live in the x stacking order, but when such a client is closed, it will be moved to the normal stacking order. Given that internal clients don't specify the desired layer, they will be moved to the normal layer, which is not really what we want because it means that the task switcher window will be placed below docks. Reviewers: #kwin, davidedmundson Reviewed By: #kwin, davidedmundson Subscribers: kwin Tags: #kwin Differential Revision: https://phabricator.kde.org/D21116 --- abstract_client.cpp | 7 +++++++ abstract_client.h | 8 ++++++++ shell_client.cpp | 5 ----- shell_client.h | 1 - 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/abstract_client.cpp b/abstract_client.cpp index c3e7849a36..12e030cd32 100644 --- a/abstract_client.cpp +++ b/abstract_client.cpp @@ -353,6 +353,8 @@ Layer AbstractClient::belongsToLayer() const // and the docks move into the NotificationLayer (which is between Above- and // ActiveLayer, so that active fullscreen windows will still cover everything) // Since the desktop is also activated, nothing should be in the ActiveLayer, though + if (isInternal()) + return UnmanagedLayer; if (isDesktop()) return workspace()->showingDesktop() ? AboveLayer : DesktopLayer; if (isSplash()) // no damn annoying splashscreens @@ -2080,4 +2082,9 @@ Group *AbstractClient::group() return nullptr; } +bool AbstractClient::isInternal() const +{ + return false; +} + } diff --git a/abstract_client.h b/abstract_client.h index 2e92096e39..5173cbd723 100644 --- a/abstract_client.h +++ b/abstract_client.h @@ -817,6 +817,14 @@ public: **/ virtual Group *group(); + /** + * Returns whether this is an internal client. + * + * Internal clients are created by KWin and used for special purpose windows, + * like the task switcher, etc. + **/ + virtual bool isInternal() const; + public Q_SLOTS: virtual void closeWindow() = 0; diff --git a/shell_client.cpp b/shell_client.cpp index c481db9f5b..b577435484 100644 --- a/shell_client.cpp +++ b/shell_client.cpp @@ -1083,11 +1083,6 @@ pid_t ShellClient::pid() const return surface()->client()->processId(); } -bool ShellClient::isInternal() const -{ - return false; -} - bool ShellClient::isLockScreen() const { return surface()->client() == waylandServer()->screenLockerClientConnection(); diff --git a/shell_client.h b/shell_client.h index 7c553eb003..699f120baf 100644 --- a/shell_client.h +++ b/shell_client.h @@ -122,7 +122,6 @@ public: **/ pid_t pid() const override; - virtual bool isInternal() const; bool isLockScreen() const override; bool isInputMethod() const override; virtual QWindow *internalWindow() const;