Skip to content

Make the Krusader Viewer window activation work on Wayland

Valentin Manea requested to merge (removed):master into master

Background(as far as I can tell): Wayland(and KWin) don't allow for a window to come to foreground and take focus away even if it belongs to the application that currently has focus. The proper way to do this is for the window that has focus to request a new activation token and pass it to the Viewer window. The Viewer window will then call KWindowSystem::setCurrentXdgActivationToken which in turn will allow KWindowSystem::activateWindow(windowHandle()) to work. Without the call to setCurrentXdgActivationToken(and the new token request) KWindowSystem::activateWindow(windowHandle()) will just blink in task bar requesting attention, but will never get focus or come to the foreground.

This patch works in both directions, if a Viewer window is open but in background and Krusader requests a new view(or edit) the Viewer window will be brought back to foreground with focus. Alternatively if the Viewer window is just about to be closed(no more tabs) then the calling window(eg. Krusader main) will be brought back to foreground. This is the same functionality as in X11.

Merge request reports