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

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Mon Feb 24 13:04:18 UTC 2020


 vcl/unx/gtk3/gtk3gtkinst.cxx |    8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

New commits:
commit 982c8bfce565bc2e2c3802924ec73e9d247044f2
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Mon Feb 24 11:20:38 2020 +0000
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Mon Feb 24 14:03:46 2020 +0100

    set the state on the widget instead of the context to get it to stick
    
    Change-Id: I76f7487957d38f155ea086fd01855149ad170166
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89339
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index fe3cd37ba8af..0875bb071251 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -7536,11 +7536,10 @@ public:
             find_menupeer_button(GTK_WIDGET(pToolButton), &pButton);
             if (pButton)
             {
-                GtkStyleContext *pWidgetContext = gtk_widget_get_style_context(GTK_WIDGET(pButton));
-                auto eState = gtk_style_context_get_state(pWidgetContext) & ~GTK_STATE_FLAG_CHECKED;
+                auto eState = gtk_widget_get_state_flags(GTK_WIDGET(pButton)) & ~GTK_STATE_FLAG_CHECKED;
                 if (bActive)
                     eState |= GTK_STATE_FLAG_CHECKED;
-                gtk_style_context_set_state(pWidgetContext, static_cast<GtkStateFlags>(eState));
+                gtk_widget_set_state_flags(GTK_WIDGET(pButton), static_cast<GtkStateFlags>(eState), true);
             }
         }
         else if (GTK_IS_TOGGLE_TOOL_BUTTON(pToolButton))
@@ -7562,8 +7561,7 @@ public:
             find_menupeer_button(GTK_WIDGET(pToolButton), &pButton);
             if (pButton)
             {
-                GtkStyleContext *pWidgetContext = gtk_widget_get_style_context(GTK_WIDGET(pButton));
-                return gtk_style_context_get_state(pWidgetContext) & GTK_STATE_FLAG_CHECKED;
+                return gtk_widget_get_state_flags(GTK_WIDGET(pButton)) & GTK_STATE_FLAG_CHECKED;
             }
         }
         else if (GTK_IS_TOGGLE_TOOL_BUTTON(pToolButton))


More information about the Libreoffice-commits mailing list