[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - 2 commits - vcl/unx

Caolán McNamara caolanm at redhat.com
Fri Jun 10 11:21:33 UTC 2016


 vcl/unx/gtk3/gtk3gtkframe.cxx |   27 +++++++++++++++++++++------
 1 file changed, 21 insertions(+), 6 deletions(-)

New commits:
commit 1d3efb7ee79e8a516945328da1ec3b5fd8ce95b4
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
    (cherry picked from commit c80d34ad551efe858c47445b13370aa8223357c7)

diff --git a/vcl/unx/gtk3/gtk3gtkframe.cxx b/vcl/unx/gtk3/gtk3gtkframe.cxx
index 8e72d6a..7f7c425 100644
--- a/vcl/unx/gtk3/gtk3gtkframe.cxx
+++ b/vcl/unx/gtk3/gtk3gtkframe.cxx
@@ -799,8 +799,10 @@ GtkSalFrame::~GtkSalFrame()
 
     InvalidateGraphics();
 
-    if( m_pParent )
+    if (m_pParent)
+    {
         m_pParent->m_aChildren.remove( this );
+    }
 
     getDisplay()->deregisterFrame( this );
 
@@ -1198,6 +1200,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
@@ -2346,11 +2354,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
commit ec0adaa492fdc1b07c876cc5618420df9b50eb84
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Jun 10 12:12:33 2016 +0100

    gtk3: use gtk_window_group_get_current_grab instead of gtk_grab_get_current
    
    now that we are using window groups, otherwise the problem of tdf#99604
    comes back
    
    Change-Id: I7a940ea72bfd7fd4a7f68f1e60395d5014ce155c
    (cherry picked from commit 9b49e1817d4d045b724aed6267f8f00c6bf295cc)

diff --git a/vcl/unx/gtk3/gtk3gtkframe.cxx b/vcl/unx/gtk3/gtk3gtkframe.cxx
index a31a2ae..8e72d6a 100644
--- a/vcl/unx/gtk3/gtk3gtkframe.cxx
+++ b/vcl/unx/gtk3/gtk3gtkframe.cxx
@@ -1432,8 +1432,9 @@ void GtkSalFrame::Show( bool bVisible, bool bNoActivate )
                 m_nFloats++;
                 if( ! getDisplay()->GetCaptureFrame() && m_nFloats == 1 )
                 {
+                    GtkWindowGroup *pWindowGroup = gtk_window_get_group(GTK_WINDOW(m_pWindow));
                     GtkWidget* pGrabWidgetBeforeShowFloat;
-                    while ((pGrabWidgetBeforeShowFloat = gtk_grab_get_current()))
+                    while ((pGrabWidgetBeforeShowFloat = gtk_window_group_get_current_grab(pWindowGroup)))
                     {
                         m_aGrabWidgetsBeforeShowFloat.push_back(pGrabWidgetBeforeShowFloat);
                         gtk_grab_remove(pGrabWidgetBeforeShowFloat);


More information about the Libreoffice-commits mailing list