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

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Mon May 10 18:58:42 UTC 2021


 vcl/unx/gtk3/gtkframe.cxx |   15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

New commits:
commit 4e5f2861154e6bccb7a77356c76c5327d8bda6c4
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Mon May 10 16:48:00 2021 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Mon May 10 20:57:50 2021 +0200

    gtk4: use gtk_window_minimize to replace gtk_window_iconify
    
    Change-Id: I6c50e6f60e24dd5bd93e1ef5f62f3cd3845f9194
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115348
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/vcl/unx/gtk3/gtkframe.cxx b/vcl/unx/gtk3/gtkframe.cxx
index 06d08ac42580..fd72d3801998 100644
--- a/vcl/unx/gtk3/gtkframe.cxx
+++ b/vcl/unx/gtk3/gtkframe.cxx
@@ -1862,7 +1862,6 @@ void GtkSalFrame::SetWindowState( const SalFrameState* pState )
             gtk_window_maximize( GTK_WINDOW(m_pWindow) );
         else
             gtk_window_unmaximize( GTK_WINDOW(m_pWindow) );
-#if !GTK_CHECK_VERSION(4, 0, 0)
         /* #i42379# there is no rollup state in GDK; and rolled up windows are
         *  (probably depending on the WM) reported as iconified. If we iconify a
         *  window here that was e.g. a dialog, then it will be unmapped but still
@@ -1871,11 +1870,17 @@ void GtkSalFrame::SetWindowState( const SalFrameState* pState )
         *  on windows with a parent (that is transient frames) since these tend
         *  to not be represented in an icon task list.
         */
-        if( (pState->mnState & WindowStateState::Minimized)
-            && ! m_pParent )
-            gtk_window_iconify( GTK_WINDOW(m_pWindow) );
+        bool bMinimize = pState->mnState & WindowStateState::Minimized && !m_pParent;
+#if GTK_CHECK_VERSION(4, 0, 0)
+        if (bMinimize)
+            gtk_window_minimize(GTK_WINDOW(m_pWindow));
+        else
+            gtk_window_unminimize(GTK_WINDOW(m_pWindow));
+#else
+        if (bMinimize)
+            gtk_window_iconify(GTK_WINDOW(m_pWindow));
         else
-            gtk_window_deiconify( GTK_WINDOW(m_pWindow) );
+            gtk_window_deiconify(GTK_WINDOW(m_pWindow));
 #endif
     }
     TriggerPaintEvent();


More information about the Libreoffice-commits mailing list