From a37b794467d3991ccecf84442ae9bfead8dc9b5f Mon Sep 17 00:00:00 2001 From: Jonathan Bauer Date: Wed, 7 Oct 2015 15:21:58 +0200 Subject: move msgBox closer to center :) TOFIX --- src/pwgui/main.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 #include +#include #include #include #include @@ -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(); -- cgit v1.2.3-55-g7522