summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-04-18 09:52:02 +0100
committerCaolán McNamara <caolanm@redhat.com>2018-04-18 12:33:14 +0200
commit71df42a8d5ec20646045ffb419b89b19fbdf4c02 (patch)
tree98ca0bc0b6632907e7428cc741a45de3580e3963
parentf08511e913de2f3a5096d3181f8d70dc6b3d2eb3 (diff)
Related: tdf#117068 inform salframe that there's a modal dialog running
Change-Id: Ie95fbc1586e11396271fb43e6117f39f4f61cb0e Reviewed-on: https://gerrit.libreoffice.org/53086 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--include/vcl/window.hxx4
-rw-r--r--vcl/source/window/dialog.cxx4
-rw-r--r--vcl/source/window/menufloatingwindow.cxx4
-rw-r--r--vcl/source/window/window.cxx4
-rw-r--r--vcl/unx/gtk3/gtk3gtkinst.cxx7
-rw-r--r--vcl/win/window/salframe.cxx4
6 files changed, 17 insertions, 10 deletions
diff --git a/include/vcl/window.hxx b/include/vcl/window.hxx
index ddc9ae0408a5..6b5dd1b8ab7c 100644
--- a/include/vcl/window.hxx
+++ b/include/vcl/window.hxx
@@ -603,8 +603,8 @@ public:
SAL_DLLPRIVATE void ImplCallResize();
SAL_DLLPRIVATE void ImplCallMove();
- SAL_DLLPRIVATE void ImplIncModalCount();
- SAL_DLLPRIVATE void ImplDecModalCount();
+ void IncModalCount();
+ void DecModalCount();
SAL_DLLPRIVATE static void ImplCalcSymbolRect( tools::Rectangle& rRect );
diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx
index 39c02f3efc28..c29227d86b25 100644
--- a/vcl/source/window/dialog.cxx
+++ b/vcl/source/window/dialog.cxx
@@ -1169,7 +1169,7 @@ void Dialog::ImplSetModalInputMode( bool bModal )
// #115933# disable the whole frame hierarchy, useful if our parent
// is a modeless dialog
mpDialogParent = pParent->mpWindowImpl->mpFrameWindow;
- mpDialogParent->ImplIncModalCount();
+ mpDialogParent->IncModalCount();
}
}
else
@@ -1179,7 +1179,7 @@ void Dialog::ImplSetModalInputMode( bool bModal )
// #115933# re-enable the whole frame hierarchy again (see above)
// note that code in getfocus assures that we do not accidentally enable
// windows that were disabled before
- mpDialogParent->ImplDecModalCount();
+ mpDialogParent->DecModalCount();
}
// Enable the prev Modal Dialog
diff --git a/vcl/source/window/menufloatingwindow.cxx b/vcl/source/window/menufloatingwindow.cxx
index a2bc5473fb2c..ea4cb3bae3ca 100644
--- a/vcl/source/window/menufloatingwindow.cxx
+++ b/vcl/source/window/menufloatingwindow.cxx
@@ -398,7 +398,7 @@ void MenuFloatingWindow::Start()
return;
bInExecute = true;
if (GetParent())
- GetParent()->ImplIncModalCount();
+ GetParent()->IncModalCount();
}
void MenuFloatingWindow::End()
@@ -407,7 +407,7 @@ void MenuFloatingWindow::End()
return;
if (GetParent() && !GetParent()->IsDisposed())
- GetParent()->ImplDecModalCount();
+ GetParent()->DecModalCount();
// restore focus to previous window if we still have the focus
VclPtr<vcl::Window> xFocusId(xSaveFocusId);
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index f5548205b846..c4db4c912977 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -3518,7 +3518,7 @@ bool Window::IsInModalMode() const
return (mpWindowImpl->mpFrameWindow->mpWindowImpl->mpFrameData->mnModalMode != 0);
}
-void Window::ImplIncModalCount()
+void Window::IncModalCount()
{
vcl::Window* pFrameWindow = mpWindowImpl->mpFrameWindow;
vcl::Window* pParent = pFrameWindow;
@@ -3532,7 +3532,7 @@ void Window::ImplIncModalCount()
pFrameWindow = pParent ? pParent->mpWindowImpl->mpFrameWindow.get() : nullptr;
}
}
-void Window::ImplDecModalCount()
+void Window::DecModalCount()
{
vcl::Window* pFrameWindow = mpWindowImpl->mpFrameWindow;
vcl::Window* pParent = pFrameWindow;
diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index 921c57920d01..4c273766bde0 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -1947,9 +1947,16 @@ public:
{
sort_native_button_order(GTK_BOX(gtk_dialog_get_action_area(m_pDialog)));
int ret;
+ GtkWindow* pParent = gtk_window_get_transient_for(GTK_WINDOW(m_pDialog));
+ GtkSalFrame* pFrame = GtkSalFrame::getFromWindow(pParent);
+ vcl::Window* pFrameWindow = pFrame ? pFrame->GetWindow() : nullptr;
while (true)
{
+ if (pFrameWindow)
+ pFrameWindow->IncModalCount();
ret = gtk_dialog_run(m_pDialog);
+ if (pFrameWindow)
+ pFrameWindow->DecModalCount();
if (ret == GTK_RESPONSE_HELP)
{
help();
diff --git a/vcl/win/window/salframe.cxx b/vcl/win/window/salframe.cxx
index a15e6924b963..a70262fc68ac 100644
--- a/vcl/win/window/salframe.cxx
+++ b/vcl/win/window/salframe.cxx
@@ -5647,7 +5647,7 @@ LRESULT CALLBACK SalFrameWndProc( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lP
if( pWin )
{
pWin->EnableInput( false, nullptr );
- pWin->ImplIncModalCount(); // #106303# support frame based modal count
+ pWin->IncModalCount(); // #106303# support frame based modal count
}
}
else
@@ -5656,7 +5656,7 @@ LRESULT CALLBACK SalFrameWndProc( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lP
if( pWin )
{
pWin->EnableInput( true, nullptr );
- pWin->ImplDecModalCount(); // #106303# support frame based modal count
+ pWin->DecModalCount(); // #106303# support frame based modal count
}
}
}