From c3d8ce5d731289ddc1255ed154a896a6cfd286b4 Mon Sep 17 00:00:00 2001 From: Vitozz Date: Sun, 19 May 2024 14:57:40 +0300 Subject: [PATCH] Added dirty hack to bring Psi window to front in wayland desktop session --- src/common.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/common.cpp b/src/common.cpp index aa8f751d7..ac3f25e4b 100644 --- a/src/common.cpp +++ b/src/common.cpp @@ -469,7 +469,7 @@ void clearMenu(QMenu *m) bool isKde() { return qgetenv("XDG_SESSION_DESKTOP") == "KDE" || qgetenv("DESKTOP_SESSION").endsWith("plasma") - || qgetenv("DESKTOP_SESSION").endsWith("plasma5"); + || qgetenv("DESKTOP_SESSION").endsWith("plasma5") || qgetenv("DESKTOP_SESSION").endsWith("plasmawayland"); } void bringToFront(QWidget *widget, bool) @@ -489,6 +489,13 @@ void bringToFront(QWidget *widget, bool) // if(grabFocus) // w->setActiveWindow(); + // dirty hack to bring window to front in wayland desktop session + if (qApp->platformName() == "wayland" && qApp->applicationState() & Qt::ApplicationInactive) { + auto flags = w->windowFlags(); + w->setWindowFlags(flags | Qt::WindowStaysOnTopHint); + w->setWindowFlags(flags & ~Qt::WindowStaysOnTopHint); + w->show(); + } w->raise(); w->activateWindow();