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

Support forceActiveWindow for Panels

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:
parent 2ad7b959
...@@ -68,6 +68,18 @@ void WindowSystem::forceActiveWindow(WId win, long int time) ...@@ -68,6 +68,18 @@ void WindowSystem::forceActiveWindow(WId win, long int time)
Q_UNUSED(time) Q_UNUSED(time)
if (PlasmaWindow *w = window(win)) { if (PlasmaWindow *w = window(win)) {
w->requestActivate(); w->requestActivate();
} else {
Surface *s = Surface::fromQtWinId(win);
if (!s) {
auto plasmaShellSurface = PlasmaShellSurface::get(s);
if (!plasmaShellSurface) {
if (plasmaShellSurface->role() == PlasmaShellSurface::Role::Panel) {
} }
} }
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