After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 699901 - GTK CSS keybinding broken
GTK CSS keybinding broken
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: Other
3.8.x
Other All
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
: 694673 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2013-05-08 08:16 UTC by Matthew Francis
Modified: 2013-05-08 14:48 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Matthew Francis 2013-05-08 08:16:39 UTC
CSS keybinding appears to have been broken since the following commit

commit 44ba5d253f5bbda2d5a42c58218ad2aa318256f4
Author: Benjamin Otte <otte@redhat.com>
Date:   Tue Aug 28 17:52:12 2012 +0200

    css: Redo bindings parsing
    
    I want to get away from the ability to have 0-length arrays, all css
    arrays are single element.
    Even if the element is "none", it is still a "none" element.



The following one-line patch makes it work again


diff --git a/gtk/gtkcssstylepropertyimpl.c b/gtk/gtkcssstylepropertyimpl.c
index ea3cb36..c189ea6 100644
--- a/gtk/gtkcssstylepropertyimpl.c
+++ b/gtk/gtkcssstylepropertyimpl.c
@@ -476,7 +476,7 @@ bindings_value_parse_one (GtkCssParser *parser)
       return NULL;
     }
 
-  if (g_ascii_strcasecmp (name, "none"))
+  if (g_ascii_strcasecmp (name, "none") == 0)
     {
       name = NULL;
     }



This can be tested quickly by e.g. creating a ~/.config/gtk-3.0/gtk.css with the following content, then running gtk3-demo and testing that the control-F2 binding is applied in the Text Widget -> Hypertext demo:

@binding-set MyBindings {
  bind "<Control>F2" { "cut-clipboard" () };
}

GtkTextView {
  gtk-key-bindings: MyBindings;
}
Comment 1 Matthias Clasen 2013-05-08 14:48:25 UTC
*** Bug 694673 has been marked as a duplicate of this bug. ***