Skip to content

Commit

Permalink
Added dirty hack to bring Psi window to front in wayland desktop session
Browse files Browse the repository at this point in the history
  • Loading branch information
Vitozz committed May 19, 2024
1 parent 8b9f5aa commit c3d8ce5
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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();

Expand Down

0 comments on commit c3d8ce5

Please sign in to comment.