Kaydet (Commit) 71df42a8 authored tarafından Caolán McNamara's avatar Caolán McNamara

Related: tdf#117068 inform salframe that there's a modal dialog running

Change-Id: Ie95fbc1586e11396271fb43e6117f39f4f61cb0e
Reviewed-on: https://gerrit.libreoffice.org/53086Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst f08511e9
......@@ -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 );
......
......@@ -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
......
......@@ -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);
......
......@@ -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;
......
......@@ -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();
......
......@@ -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
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment