Window: Do not raise the Hide event twice.

[GB.QT4]
* BUG: Window: Do not raise the Hide event twice.

[GB.QT5]
* BUG: Window: Do not raise the Hide event twice.
This commit is contained in:
gambas 2022-01-28 23:49:53 +01:00
parent 1308dc95ab
commit 742244fe34
2 changed files with 8 additions and 2 deletions

View file

@ -2983,6 +2983,8 @@ void CWINDOW_activate(CWIDGET *ob)
{
CWINDOW *active;
//fprintf(stderr, "CWINDOW_activate: %s\n", ob ? ob->name : NULL);
//qDebug("CWINDOW_activate: %s", ob ? ob->name : NULL);
if (ob)
@ -3064,6 +3066,8 @@ bool CWindow::eventFilter(QObject *o, QEvent *e)
{
MyMainWindow *w = (MyMainWindow *)o;
THIS->noHideEvent = false;
if (THIS->toplevel && !THIS->popup && !THIS->moved)
w->center();
@ -3081,9 +3085,10 @@ bool CWindow::eventFilter(QObject *o, QEvent *e)
}
else if (e->type() == QEvent::Hide) // && !e->spontaneous())
{
//qDebug("Hide: %s %d (%d)", GB.GetClassName(THIS), WINDOW->isHidden(), e->spontaneous());
//if (WINDOW->isHidden())
//fprintf(stderr, "Hide: %p %s %d (%d)\n", o, GB.GetClassName(THIS), WINDOW->isHidden(), e->spontaneous());
if (!THIS->noHideEvent)
{
THIS->noHideEvent = true;
GB.Raise(THIS, EVENT_Hide, 0);
if (!e->spontaneous())
CACTION_raise(THIS);

View file

@ -100,6 +100,7 @@ typedef
unsigned popup : 1;
unsigned modal : 1;
unsigned noHideEvent : 1;
}
CWINDOW;