summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2019-10-02 14:31:59 +0100
committerCaolán McNamara <caolanm@redhat.com>2019-10-02 17:14:55 +0200
commit6e7d9c4582c05eee47b0b455444e66b4f2445785 (patch)
tree24aa453eac977c3471b8447678e9f3261fee309c
parent5761a23608e3ed9744711666e7465d11a450dc58 (diff)
Resolves: tdf#127904 modal depth dips below 0
when validation dialog is run modally, but changed itself to unmodal during execution. only NotifyModalHierarchy on modal<->unmodal transition and not on modality depth Change-Id: I85d4f67e5b0426aafbf80b1ae25fc3e3f19717af Reviewed-on: https://gerrit.libreoffice.org/80039 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--vcl/unx/gtk3/gtk3gtkinst.cxx13
1 files changed, 5 insertions, 8 deletions
diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index e31fb2371bb3..7b5356bee72e 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -3537,8 +3537,9 @@ struct DialogRunner
if (m_xFrameWindow)
{
m_xFrameWindow->IncModalCount();
+ if (m_nModalDepth == 0)
+ m_xFrameWindow->ImplGetFrame()->NotifyModalHierarchy(true);
++m_nModalDepth;
- m_xFrameWindow->ImplGetFrame()->NotifyModalHierarchy(true);
}
}
@@ -3548,7 +3549,8 @@ struct DialogRunner
{
m_xFrameWindow->DecModalCount();
--m_nModalDepth;
- m_xFrameWindow->ImplGetFrame()->NotifyModalHierarchy(false);
+ if (m_nModalDepth == 0)
+ m_xFrameWindow->ImplGetFrame()->NotifyModalHierarchy(false);
}
}
@@ -3608,13 +3610,8 @@ struct DialogRunner
// if, like the calc validation dialog does, the modality was
// toggled off during execution ensure that on cleanup the parent
// is left in the state it was found
- SalFrame* pFrame = m_xFrameWindow->ImplGetFrame();
- do
- {
+ while (m_nModalDepth++ < 0)
m_xFrameWindow->IncModalCount();
- pFrame->NotifyModalHierarchy(true);
- }
- while (++m_nModalDepth < 0);
}
}
};