! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Control modifier appears as Primary when setting shortcuts
Keyboard Settings


Description José Romildo Malaquias 2011-10-20 15:07:20 CEST
After upgrading gtk+ to version 2.24.7, the <Primary> modifier is used instead of the <Control> modifier when setting a keyboard shortcut that uses the control key.

Previously set shortcuts that uses the <Control> modifier stopped working.

This happens in the keyboard settings and in the Window Manager settings dialogs.

This behavior seems to be related to the commit 24a42839babddc8130226663a97453fe8b0f8d45 on the Gtk+ git repository, on 26th of September.
Comment 1 Tomáš Navrátil 2011-10-23 22:35:47 CEST
I can confirm this issue. It is appearing on my Arch Linux 64-bit after upgrading the package gtk2 from 2.24.6-2 to 2.24.7-1.
Comment 2 Tomáš Navrátil 2011-10-25 23:39:10 CEST
I have informed the author of the commit of the issue and am posting his reply as per his permission:

> ...It seems your commit 1f6a921158b5a4fa80ea2e844ce25aad04101aaf in GTK+ 2.24.7 has broken shortcuts using <Control> in Xfce 4.8 on Linux
(https://bugzilla.xfce.org/show_bug.cgi?id=8056). Since the commit seems to be a
part of OS X updates
(http://ftp.gnome.org/pub/gnome/sources/gtk+/2.24/gtk+-2.24.7.news), shouldn't
the <Primary> accelerator appear only on Mac OS X?

Yep that's known.

You probably use a copy of eggcellrendereraccel.c and friends?
gnome-control-center fixed this by adding support for <Primary>,
but the recommendation is to use GtkCellRendererAccel and *not*
parse serialized accel strings yourself (or do both the
serialization and deserialization yourself).

Using primary on the mac only is not an option, because then
we could use <meta> right away, and the whole idea of specifying
accels cross-platform would be poof.

I know this is an unexpected fallout, but for now we are
trying to fix the situation without getting rid of <primary>

Comment 3 Kevin Fenzi 2011-11-12 01:13:46 CET
From downstream bug https://bugzilla.redhat.com/show_bug.cgi?id=753312 

"gnome-control-center has a workaround for the problem:

Could we use something similar?
Comment 4 Jérôme Guelfucci editbugs 2011-11-14 18:30:58 CET
The problem is not that we miss-use some API, we are already using gtk_accelerator_{name,parse} to do all the parsing in both ways.

The problem is that we store the "name" of the shortcut which was <Control>... and now is <Primary>.... IMO, the GTK+ guys did a mistake with this, breaking this naming convention in a stable release is not really nice.

A quick'n dirty solution would be to replace all occurrences of <Control> with <Primary>. But that'll make <Primary> appear all over the place in the UI and it's not exactly clear that it means Ctrl so we should maybe implement a function which converts the GTK accelerator string into a readable string.
Comment 5 Christian Dywan 2011-11-14 19:21:21 CET
(In reply to comment #4)
> The problem is not that we miss-use some API, we are already using
> gtk_accelerator_{name,parse} to do all the parsing in both ways.

I can reproduce it on Fedora 16. From a first quick look the problem could be solved by using GtkCellRendererAccel with the side effect of localized modifier names.
Comment 6 Seong-Kook Shin 2012-12-28 01:01:00 CET
Don't know if this affects my GTK based Emacs, but..

I used to make a key binding (in Emacs) control-tab.

Suddenly (I confess that I upgrade too many packages in Gentoo, so I don't exactly know which causes this problem),

1. Xfce shows <control> shortcut to <Primary>,
2. Emacs (and xev too) cannot catch control + tab.  It's like window manage did not pass the key press event to the application.
Comment 7 Jérôme Guelfucci editbugs 2012-12-30 15:57:47 CET
Fixed in git master branch, we now show the shortcut labels instead of the raw accelerator string.
Comment 8 83185F1A 2013-11-24 20:39:06 CET
This seems to be back in x64 XFCE 4.10

Bug #8056

Reported by:
José Romildo Malaquias
Reported on: 2011-10-20
Last modified on: 2013-11-24


Jérôme Guelfucci
CC List:
8 users




Additional information