summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2019-09-26 12:19:57 +0100
committerCaolán McNamara <caolanm@redhat.com>2019-09-26 16:46:10 +0200
commit70e5fbcf28fe5eec16f32536adf4b506857d88cf (patch)
treeab6320aa11a70bfa06fc01a212583e8c67e951f6
parent622a11cf60d9772d6f66ad99a6bd1ef0a3bacb4e (diff)
get toplevel GtkWindow if parent is a child frame
Change-Id: I9645259dd8c7fb331b2efab3f441422ee1f07c12 Reviewed-on: https://gerrit.libreoffice.org/79599 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--vcl/unx/gtk3/gtk3gtkframe.cxx11
1 files changed, 6 insertions, 5 deletions
diff --git a/vcl/unx/gtk3/gtk3gtkframe.cxx b/vcl/unx/gtk3/gtk3gtkframe.cxx
index 96be79e3d106..0b1065b13147 100644
--- a/vcl/unx/gtk3/gtk3gtkframe.cxx
+++ b/vcl/unx/gtk3/gtk3gtkframe.cxx
@@ -1073,17 +1073,18 @@ void GtkSalFrame::Init( SalFrame* pParent, SalFrameStyleFlags nStyle )
updateWMClass();
}
- if( m_pParent && m_pParent->m_pWindow && ! isChild() )
- gtk_window_set_screen( GTK_WINDOW(m_pWindow), gtk_window_get_screen( GTK_WINDOW(m_pParent->m_pWindow) ) );
-
if (GTK_IS_WINDOW(m_pWindow))
{
if (m_pParent)
{
+ GtkWidget* pTopLevel = gtk_widget_get_toplevel(m_pParent->m_pWindow);
+ if (!isChild())
+ gtk_window_set_screen(GTK_WINDOW(m_pWindow), gtk_window_get_screen(GTK_WINDOW(pTopLevel)));
+
if (!(m_pParent->m_nStyle & SalFrameStyleFlags::PLUG))
- gtk_window_set_transient_for( GTK_WINDOW(m_pWindow), GTK_WINDOW(m_pParent->m_pWindow) );
+ gtk_window_set_transient_for(GTK_WINDOW(m_pWindow), GTK_WINDOW(pTopLevel));
m_pParent->m_aChildren.push_back( this );
- gtk_window_group_add_window(gtk_window_get_group(GTK_WINDOW(m_pParent->m_pWindow)), GTK_WINDOW(m_pWindow));
+ gtk_window_group_add_window(gtk_window_get_group(GTK_WINDOW(pTopLevel)), GTK_WINDOW(m_pWindow));
}
else
{