From 807893eed817a734c295c762ae9dcc19c5e99da1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Minisini?= Date: Mon, 7 Sep 2015 00:30:33 +0000 Subject: [PATCH] [GB.QT4] * BUG: Fix initial window screen again. [GB.QT5] * BUG: Fix initial window screen again. git-svn-id: svn://localhost/gambas/trunk@7286 867c0c6c-44f3-4631-809d-bfa615b0a4ec --- gb.qt4/src/CWindow.cpp | 4 +++- gb.qt4/src/CWindow.h | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/gb.qt4/src/CWindow.cpp b/gb.qt4/src/CWindow.cpp index da39c74fb..eca5f8a60 100644 --- a/gb.qt4/src/CWindow.cpp +++ b/gb.qt4/src/CWindow.cpp @@ -1850,6 +1850,7 @@ void MyMainWindow::showPopup(QPoint &pos) setWindowFlags(Qt::Popup | flags); setWindowModality(Qt::ApplicationModal); + THIS->popup = true; /*if (_resizable && _border) { @@ -1895,6 +1896,7 @@ void MyMainWindow::showPopup(QPoint &pos) { setWindowModality(Qt::NonModal); setWindowFlags(Qt::Window | flags); + THIS->popup = false; } CWIDGET_leave_popup(save_popup); @@ -2697,7 +2699,7 @@ bool CWindow::eventFilter(QObject *o, QEvent *e) { MyMainWindow *w = (MyMainWindow *)o; - if (THIS->toplevel && (w->windowFlags() & Qt::Popup) == 0 && (!THIS->moved || w->isModal())) + if (THIS->toplevel && !THIS->popup && (!THIS->moved || w->isModal())) w->center(); //handle_focus(THIS); diff --git a/gb.qt4/src/CWindow.h b/gb.qt4/src/CWindow.h index 9cd4c08fe..b5367f215 100644 --- a/gb.qt4/src/CWindow.h +++ b/gb.qt4/src/CWindow.h @@ -87,6 +87,7 @@ typedef unsigned sticky : 1; unsigned noTakeFocus : 1; unsigned moved : 1; + unsigned popup : 1; } CWINDOW;