diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-03-12 11:21:12 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2021-03-12 15:39:17 +0100 |
commit | ba123c6b03545f9c111c997d21b7dddf50399bf2 (patch) | |
tree | 228ce2d1922b41075cd557483824eb199d528ea4 /vcl | |
parent | e1dbdfc133a81eb065fb1426a2bd0f36244f5346 (diff) |
[Inc/Dec]ModalCount on parent frame so it knows it is in modal mode
which is something we do on welded dialog already, but the prior
native file dialog integration lacked this to date
Change-Id: Ia1c3b81d5a2d567731215f367fcf37b750c51ee7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112383
Tested-by: Caolán McNamara <caolanm@redhat.com>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/unx/gtk3/fpicker/SalGtkPicker.cxx | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/vcl/unx/gtk3/fpicker/SalGtkPicker.cxx b/vcl/unx/gtk3/fpicker/SalGtkPicker.cxx index f1bcbfc4d265..7502d5af290b 100644 --- a/vcl/unx/gtk3/fpicker/SalGtkPicker.cxx +++ b/vcl/unx/gtk3/fpicker/SalGtkPicker.cxx @@ -187,7 +187,25 @@ gint RunDialog::run() mxToolkit->addTopWindowListener(this); mxDesktop->addTerminateListener(this); + + // [Inc/Dec]ModalCount on parent frame so it knows it is in modal mode + GtkWindow* pParent = gtk_window_get_transient_for(GTK_WINDOW(mpDialog)); + GtkSalFrame* pFrame = pParent ? GtkSalFrame::getFromWindow(GTK_WIDGET(pParent)) : nullptr; + VclPtr<vcl::Window> xFrameWindow = pFrame ? pFrame->GetWindow() : nullptr; + if (xFrameWindow) + { + xFrameWindow->IncModalCount(); + xFrameWindow->ImplGetFrame()->NotifyModalHierarchy(true); + } + gint nStatus = gtk_dialog_run(GTK_DIALOG(mpDialog)); + + if (xFrameWindow) + { + xFrameWindow->DecModalCount(); + xFrameWindow->ImplGetFrame()->NotifyModalHierarchy(false); + } + mxDesktop->removeTerminateListener(this); if (mxToolkit.is()) |