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

Related: rhbz#1290014 gtk3: use gtk_window_set_modal on modal dialogs

which makes modal dialogs (which are most of them) place correctly
under wayland. Modeless ones are still uselessly shoved far to the
left, but this makes things near usable and gives the same "graying
into the bg" effect for the main window as other gtk apps

Change-Id: If1486feb7631c5a0c2aa6efac3a6b9dd1b215daf
Reviewed-on: https://gerrit.libreoffice.org/20699Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
(cherry picked from commit 8d582298)
Reviewed-on: https://gerrit.libreoffice.org/20700
üst 02d09f42
......@@ -239,6 +239,10 @@ public:
// done setting up the clipregion
virtual void EndSetClipRegion() = 0;
virtual void SetModal(bool /*bModal*/)
{
}
// Callbacks (indepent part in vcl/source/window/winproc.cxx)
// for default message handling return 0
void SetCallback( vcl::Window* pWindow, SALFRAMEPROC pProc );
......
......@@ -447,6 +447,10 @@ public:
// done setting up the clipregion
virtual void EndSetClipRegion() override;
#if GTK_CHECK_VERSION(3,0,0)
virtual void SetModal(bool bModal) override;
#endif
static GtkSalFrame *getFromWindow( GtkWindow *pWindow );
virtual Window GetX11Window() override;
......
......@@ -46,6 +46,7 @@
#include <vcl/msgbox.hxx>
#include <vcl/unowrap.hxx>
#include <vcl/settings.hxx>
#include <salframe.hxx>
#include <iostream>
......@@ -1032,7 +1033,6 @@ void Dialog::SetModalInputMode( bool bModal )
mpDialogParent = pParent->mpWindowImpl->mpFrameWindow;
mpDialogParent->ImplIncModalCount();
}
}
else
{
......@@ -1068,6 +1068,7 @@ void Dialog::SetModalInputMode( bool bModal )
}
}
}
ImplGetFrame()->SetModal(bModal);
}
void Dialog::SetModalInputMode( bool bModal, bool bSubModalDialogs )
......
......@@ -2343,6 +2343,13 @@ void GtkSalFrame::EndSetClipRegion()
gdk_window_shape_combine_region( widget_get_window(m_pWindow), m_pRegion, 0, 0 );
}
void GtkSalFrame::SetModal(bool bModal)
{
if (!m_pWindow)
return;
gtk_window_set_modal(GTK_WINDOW(m_pWindow), bModal);
}
gboolean GtkSalFrame::signalButton( GtkWidget*, GdkEventButton* pEvent, gpointer frame )
{
GtkSalFrame* pThis = static_cast<GtkSalFrame*>(frame);
......
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