[Libreoffice-commits] core.git: vcl/unx

Caolán McNamara caolanm at redhat.com
Wed Jun 8 10:53:07 UTC 2016


 vcl/unx/gtk3/gtk3gtkframe.cxx |   24 +++++++++++++++++++-----
 1 file changed, 19 insertions(+), 5 deletions(-)

New commits:
commit c80d34ad551efe858c47445b13370aa8223357c7
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Jun 8 11:50:42 2016 +0100

    gtk3: use window groups so modal dialog are modal to their toplevel frame only
    
    so e.g. launching help from a modal dialog gives a new toplevel window
    which is not blocked by the modal dialog on the other window.
    
    likesize can go from one blocked e.g. writer window to calc and type away in
    there happily
    
    Change-Id: Id9376b393514e91dfd667dfce132f1f37367084e

diff --git a/vcl/unx/gtk3/gtk3gtkframe.cxx b/vcl/unx/gtk3/gtk3gtkframe.cxx
index ee02b03..f6f3694 100644
--- a/vcl/unx/gtk3/gtk3gtkframe.cxx
+++ b/vcl/unx/gtk3/gtk3gtkframe.cxx
@@ -796,8 +796,10 @@ GtkSalFrame::~GtkSalFrame()
 
     InvalidateGraphics();
 
-    if( m_pParent )
+    if (m_pParent)
+    {
         m_pParent->m_aChildren.remove( this );
+    }
 
     getDisplay()->deregisterFrame( this );
 
@@ -1196,6 +1198,12 @@ void GtkSalFrame::Init( SalFrame* pParent, SalFrameStyleFlags nStyle )
         if (!(m_pParent->m_nStyle & SalFrameStyleFlags::PLUG))
             gtk_window_set_transient_for( GTK_WINDOW(m_pWindow), GTK_WINDOW(m_pParent->m_pWindow) );
         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));
+    }
+    else
+    {
+        gtk_window_group_add_window(gtk_window_group_new(), GTK_WINDOW(m_pWindow));
+        g_object_unref(gtk_window_get_group(GTK_WINDOW(m_pWindow)));
     }
 
     // set window type
@@ -2343,11 +2351,17 @@ const SystemEnvData* GtkSalFrame::GetSystemData() const
 
 void GtkSalFrame::SetParent( SalFrame* pNewParent )
 {
-    if( m_pParent )
-        m_pParent->m_aChildren.remove( this );
+    if (m_pParent)
+    {
+        gtk_window_group_remove_window(gtk_window_get_group(GTK_WINDOW(m_pParent->m_pWindow)), GTK_WINDOW(m_pWindow));
+        m_pParent->m_aChildren.remove(this);
+    }
     m_pParent = static_cast<GtkSalFrame*>(pNewParent);
-    if( m_pParent )
-        m_pParent->m_aChildren.push_back( this );
+    if (m_pParent)
+    {
+        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));
+    }
     if( ! isChild() )
         gtk_window_set_transient_for( GTK_WINDOW(m_pWindow),
                                       (m_pParent && ! m_pParent->isChild(true,false)) ? GTK_WINDOW(m_pParent->m_pWindow) : nullptr


More information about the Libreoffice-commits mailing list