Sample Header Ad - 728x90

F10 keybinding of unknown origin (maybe Gnome?)

0 votes
1 answer
60 views
I am running Fedora 40 which I installed a few months ago. I noticed that F10 in my Emacs does not run the function that I have assigned to it in Emacs: in fact, Emacs does not see the F10 key any longer (and I am pretty sure that this started happening when I upgraded to Fedora 40: it was working fine in Fedora 38 - I skipped Fedora 39). I can tell that Emacs does not see the key by using C-h C-k, the help function to describe a key, and pressing F10. Usually, the key is echoed in Emacs's echo area and the command bound to it is reported. In the F10 case, nothing is echoed in the echo area. Instead the File menu is dropped down. That behavior seems to be somewhat general: both Firefox and Thunderbird exhibit the same behavior, which is another reason to conclude that the desktop environment is what's doing this. Not every application does this however: in gnome-terminal and xterm, F10 apparently just generates an escape sequence: ^[[21~. I did gsettings list-recursively and found one entry using F10: that looked promising, so I set it to empty:
$ gsettings get org.gnome.desktop.interface menubar-accel
'F10'
$ gsettings set org.gnome.desktop.interface menubar-accel ''
$ gsettings get org.gnome.desktop.interface menubar-accel
''
but that didn't do anything AFAICT (after various levels of restarting: restarting Emacs, logging out and back in, rebooting, shutting down and starting from scratch). As far as I know, all the graphical widget thingies (Settings, Tweaks, etc.) are using the Gsettings API underneath, so this *should* have found the culprit - but no dice. Since Emacs is built with libgtk-3.0, I also tried a GTK setting as described in [this answer](https://unix.stackexchange.com/a/40685/230615) but that also did not make any difference. Although my main interest is to free up F10 from whoever its current master is and allow it to be passed to Emacs, I'd also be interested in any tips/hacks/methods you have come up with to deal with similar problems. Any ideas? Version info: - OS: Fedora 40 - Kernel: Linux 6.9.12-200.fc40.x86_64 #1 SMP PREEMPT_DYNAMIC Sat Jul 27 15:56:15 UTC 2024 x86_64 GNU/Linux - Gnome: 46.3 - Emacs: bleeding-edge upstream, unreleased (31.0.50), but it also happens in the Emacs that comes with Fedora 40: GNU Emacs 29.4 (build 1, x86_64-redhat-linux-gnu, GTK+ Version 3.24.42, cairo version 1.18.0) of 2024-07-16 If more information is needed, I'd be happy to supply it: please let me know. UPDATE: in response to the comment by David G. below, xev does see F10 (and so do gnome-terminal and xterm as mentioned above, and of course whatever makes the File menu to drop down in the case of Emacs, Firefox and Thunderbird). The problem is not that it is not seen: the problem is that it is grabbed before I want it to be grabbed and I don't know what grabs it. That's what I'm trying to find out in the hope that I can convince that something to keep its hands off my F10 :) In response to further comments by David G. (thanks for the responses and for keeping me honest!), I tried emacs -Q which starts Emacs without any initialization files (either site-init (site-start.el or user-init or early-init). But the GTK suggestion is intriguing. I built an Emacs without a toolkit at all and it behaves as expected wrt to F10: the key is visible and I can bind it to a command. I then found [this section](https://docs.gtk.org/gtk4/class.Window.html#shortcuts-and-gestures) in the GTK documentation: it's about GTK4 and I cannot find the equivalent in the GTK3 documentation, but I'm assuming that the behavior is the same in the two versions. I'm no GTK programmer, so I don't know how to turn this behavior off yet, but it seems clear that David G. was right when he fingered the GTK interface in Emacs as the culprit.
Asked by NickD (3018 rep)
Aug 9, 2024, 05:51 PM
Last activity: Aug 11, 2024, 01:38 AM