Commit 571072cc authored by Martin Flöser's avatar Martin Flöser
Browse files

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
parent 2ad7b959
......@@ -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);
}
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment