summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Gräßlin <[email protected]>2016-10-12 14:47:36 +0200
committerMartin Gräßlin <[email protected]>2016-10-12 14:49:57 +0200
commit571072cccba559182dc6786aca139816660f3442 (patch)
tree9e5b69380988114b0b445de243e7dd364785c38d
parent2ad7b959ebdb41ab7657c4539b38fe5271f50ffa (diff)
Support forceActiveWindow for Panels
Summary: On X11 a panel can be activated by setting it to type dock and then force activating it. This change implements this behavior for Wayland by checking whether a window refers to a PlasmaShellSurface of type Panel and then sets the hint that it wants to get focus. For other window types the force activate is still not supported and this is also (mostly) the correct behavior. Reviewers: #plasma_on_wayland Subscribers: plasma-devel Tags: #plasma_on_wayland Differential Revision: https://phabricator.kde.org/D3036
-rw-r--r--src/windowsystem/windowsystem.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/windowsystem/windowsystem.cpp b/src/windowsystem/windowsystem.cpp
index 0cae543..52e440a 100644
--- a/src/windowsystem/windowsystem.cpp
+++ b/src/windowsystem/windowsystem.cpp
@@ -68,6 +68,18 @@ void WindowSystem::forceActiveWindow(WId win, long int time)
Q_UNUSED(time)
if (PlasmaWindow *w = window(win)) {
w->requestActivate();
+ } else {
+ Surface *s = Surface::fromQtWinId(win);
+ if (!s) {
+ return;
+ }
+ auto plasmaShellSurface = PlasmaShellSurface::get(s);
+ if (!plasmaShellSurface) {
+ return;
+ }
+ if (plasmaShellSurface->role() == PlasmaShellSurface::Role::Panel) {
+ plasmaShellSurface->setPanelTakesFocus(true);
+ }
}
}