Commit 24644887 authored by Friedrich W. H. Kossebau's avatar Friedrich W. H. Kossebau Committed by Tobias Fella
Browse files

Modernize code to activate window on user activation

* use KWindowSystem::updateStartupId() for abstract update of X11
  startup id or wayland activation token
* call QWindow::raise() also for wayland to prepare when it will
  support it
* call KWindowSystem::activateWindow() for all platforms, like done
  by other apps on user-triggered activation
parent a29ec0a1
Pipeline #124418 passed with stage
in 1 minute and 36 seconds
......@@ -24,6 +24,7 @@
#include <KDBusService>
#endif
#ifdef HAVE_WINDOWSYSTEM
#include <kwindowsystem_version.h>
#include <KWindowSystem>
#endif
#include <KLocalizedContext>
......@@ -78,12 +79,15 @@ using namespace Quotient;
#ifdef HAVE_WINDOWSYSTEM
static void raiseWindow(QWindow *window)
{
#if KWINDOWSYSTEM_VERSION >= QT_VERSION_CHECK(5, 91, 0)
KWindowSystem::updateStartupId(window);
#else
if (KWindowSystem::isPlatformWayland()) {
KWindowSystem::setCurrentXdgActivationToken(qEnvironmentVariable("XDG_ACTIVATION_TOKEN"));
KWindowSystem::activateWindow(window->winId());
} else {
window->raise();
}
#endif
KWindowSystem::activateWindow(window->winId());
window->raise();
}
#endif
......
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