From ed5768181e3091baf4fc61c146138320e3a8b06d Mon Sep 17 00:00:00 2001 From: David Edmundson Date: Fri, 20 Dec 2019 14:22:42 +0100 Subject: [PATCH] Honour panelTakesFocus for other plasmashell types Summary: The semantics of a window taking focus on user interaction apply to more roles. See D25851. Given it is used by `KWindowSystem::forceActivateWindow` in kwayland-integration, it makes sense to pass focus to the window once it gets this property set. Reviewers: #kwin Subscribers: kwin Tags: #kwin Differential Revision: https://phabricator.kde.org/D25968 --- xdgshellclient.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/xdgshellclient.cpp b/xdgshellclient.cpp index 72865ac9f8..e9d5bc2912 100644 --- a/xdgshellclient.cpp +++ b/xdgshellclient.cpp @@ -1409,6 +1409,11 @@ void XdgShellClient::installPlasmaShellSurface(PlasmaShellSurfaceInterface *surf workspace()->updateClientArea(); } }; + connect(surface, &PlasmaShellSurfaceInterface::panelTakesFocusChanged , this, [this, surface]() { + if (surface->panelTakesFocus()) { + workspace()->activateClient(this); + } + }); connect(surface, &PlasmaShellSurfaceInterface::positionChanged, this, updatePosition); connect(surface, &PlasmaShellSurfaceInterface::roleChanged, this, updateRole); connect(surface, &PlasmaShellSurfaceInterface::panelBehaviorChanged, this,