From 28b4ba76d6d8ff5d08451ce4ccec3aa5bb0230bb Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Thu, 28 Feb 2019 12:42:07 +0100 Subject: Try harder to get window on top --- src/widget.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/widget.cpp b/src/widget.cpp index cff1ccd..62953d2 100644 --- a/src/widget.cpp +++ b/src/widget.cpp @@ -195,8 +195,15 @@ Widget::Widget(QWidget *parent) : connect(Bus::inst(), &Bus::serviceConnected, [=](bool isSession) { qDebug() << "\\o/ Received DBus connect notification \\o/"; if (isSession) { // Session bus means user triggered, show immediately - this->show(); - this->raise(); + // Try to be very aggressive to get on top, since we don't want the + // window to hang around behind the full screen VMplayer + setWindowFlag(Qt::WindowStaysOnTopHint, false); + this->hide(); + QTimer::singleShot(10, [=]() { + this->show(); + setWindowFlag(Qt::WindowStaysOnTopHint, true); + this->raise(); + }); } else { // Otherwise, systembus means udev event -- take normal route popupGui(); } -- cgit v1.2.3-55-g7522