summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/pwgui/main.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/pwgui/main.cpp b/src/pwgui/main.cpp
index 9a8dd36..edd594c 100644
--- a/src/pwgui/main.cpp
+++ b/src/pwgui/main.cpp
@@ -2,6 +2,7 @@
#include "config.h"
#include <QApplication>
#include <QMessageBox>
+#include <QDesktopWidget>
#include <cups/backend.h>
#include <fcntl.h>
#include <sys/stat.h>
@@ -570,12 +571,15 @@ static void helper_messageBox(const char *caption, const char *text, const bool
QMessageBox msgBox;
msgBox.setWindowTitle(QString::fromUtf8(caption));
msgBox.setText(QString::fromUtf8(text));
- msgBox.setWindowFlags(Qt::WindowStaysOnTopHint);
+ msgBox.setWindowFlags(Qt::WindowStaysOnTopHint | Qt::X11BypassWindowManagerHint);
if (error) {
msgBox.setIcon(QMessageBox::Critical);
} else {
msgBox.setIcon(QMessageBox::Information);
}
+ QRect desktopRect = QApplication::desktop()->screenGeometry();
+ msgBox.move(desktopRect.width()/2-msgBox.width()/2,
+ desktopRect.height()/2-msgBox.height()/2);
msgBox.show();
msgBox.showNormal();
msgBox.raise();