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 672950 - egg_accelerator_parse_virtual fails to process 0x## keycodes
egg_accelerator_parse_virtual fails to process 0x## keycodes
Status: RESOLVED OBSOLETE
Product: libegg
Classification: Other
Component: treeviewutils
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtktreeview-bugs
Libegg maintenance
Depends on:
Blocks:
 
 
Reported: 2012-03-27 20:16 UTC by Daniel Drake
Modified: 2021-06-10 20:51 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Daniel Drake 2012-03-27 20:16:10 UTC
Previously, egg_accelerator_parse_virtual() worked fine for passing codes such as 0x93. However, this is broken with recent GDK versions.

The code does this:

          keyval = gdk_keyval_from_name (accelerator);

          if (keyval == 0)
	    {
	      /* If keyval is 0, then maybe it's a keycode.  Check for 0x## */

i.e. it is also expecting gdk_keyval_from_name to refuse to process input strings of form "0x##".

However, GDK as provided by GTK+-2.24.10 and GDK3 from GTK+-3.2.3 both interpret strings such as this one:


Python 2.7.2 (default, Oct 27 2011, 01:36:46) 
[GCC 4.6.1 20111003 (Red Hat 4.6.1-10)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from gi.repository import Gdk
>>> Gdk.keyval_from_name("0x93")
147L

So, eggaccelerators should now check if the string is of form 0x## *before* deciding whether to use gdk_keyval_from_name or not.
Comment 1 Matthias Clasen 2012-03-29 00:42:57 UTC
Or you could simply use gtk_accelerator_parse or its more flexible variant
gtk_accelerator_parse_with_keycode, which handle 0x## keycodes nowadays.
Comment 2 Daniel Drake 2012-03-30 14:37:40 UTC
Thanks for pointing that out. I opened a ticket at http://bugs.sugarlabs.org/ticket/3412 so that we switch to it at some point.

Perhaps this code can be removed from libegg now?
Comment 3 André Klapper 2021-06-10 20:51:38 UTC
GNOME is going to shut down bugzilla.gnome.org in favor of gitlab.gnome.org.
As part of that, we are mass-closing older open tickets in bugzilla.gnome.org
which have not seen updates for a longer time (resources are unfortunately
quite limited so not every ticket can get handled).

If you can still reproduce the situation described in this ticket in a recent
and supported software version of libegg, then please follow
  https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines
and create a new ticket at
  https://gitlab.gnome.org/GNOME/libegg/-/issues/

Thank you for your understanding and your help.