Modal windows are now actually modal before entering their Open event.

[GB.QT4]
* BUG: Modal windows are now actually modal before entering their Open event.

[GB.QT5]
* BUG: Modal windows are now actually modal before entering their Open event.
This commit is contained in:
gambas 2020-05-23 10:02:02 +02:00
parent 7b4b6b3152
commit c5ff52f645
2 changed files with 14 additions and 11 deletions

View file

@ -726,19 +726,21 @@ BEGIN_METHOD_VOID(Window_ShowModal)
if (check_opened(THIS, TRUE))
return;
THIS->ret = 0;
if (!emit_open_event(THIS))
if (!THIS->toplevel)
{
if (THIS->toplevel)
{
//THIS->widget.flag.visible = true;
WINDOW->showModal();
//THIS->widget.flag.visible = false;
}
GB.Error("The window is not top-level");
return;
}
THIS->ret = 0;
THIS->modal = TRUE;
if (!emit_open_event(THIS))
WINDOW->showModal();
THIS->modal = FALSE;
GB.ReturnInteger(THIS->ret);
END_METHOD
@ -772,7 +774,7 @@ END_METHOD
BEGIN_PROPERTY(Window_Modal)
if (THIS->toplevel)
GB.ReturnBoolean(WINDOW->isModal());
GB.ReturnBoolean(THIS->modal);
else
GB.ReturnBoolean(false);

View file

@ -88,6 +88,7 @@ typedef
unsigned noTakeFocus : 1;
unsigned moved : 1;
unsigned popup : 1;
unsigned modal : 1;
}
CWINDOW;