GNOME Bugzilla – Bug 601926
Don't hardcode meta to alt
Last modified: 2010-09-02 18:47:05 UTC
I think keymap.h has a typo near the beginning: #define VTE_META_MASK GDK_MOD1_MASK should be: #define VTE_META_MASK GDK_MOD4_MASK As MOD4 is for meta key MOD1 is the alt key. After changing, I could use my win key as meta after changing gnome's keyboard settings.
Why do you think so?
A couple of reasons: 1) Bug 31316 (https://bugzilla.gnome.org/show_bug.cgi?id=31316) also said that alt used as meta regardless what is set to meta in gnome's keyboard settings. I thought to open a new bug as in 31316 it is also asked to set the high bit. 2) Alexander Blazej on http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=411199 talks also about this problem. 3) I have the same problem as Alexander Blazej: I set in the gnome's keyboard settings Win to meta key. So Win is my meta key. Alt is my Alt key. Then I start gnome-terminal. And in irssi alt is used as meta key, the win key does nothing. After recompiling vte with the change above, win is the meta key. 4)xmodmap output, which shows that mod1 is alt, mod4 is meta xmodmap: up to 5 keys per modifier, (keycodes in parentheses): shift Shift_L (0x32), Shift_R (0x3e) lock Caps_Lock (0x42) control Control_L (0x25), Control_R (0x69) mod1 Alt_L (0x40) mod2 Num_Lock (0x4d) mod3 mod4 Meta_L (0x85), Meta_R (0x86), Meta_L (0xcd), Super_L (0xce), Hyper_L (0xcf) mod5 ISO_Level3_Shift (0x5c), Mode_switch (0xcb) I hope, I could help.
Further investigating, I am wrong about mod4 is meta and mod1 is alt. It's unclear for me what these modifiers mean. In default config meta belongs to mod1, if win is the meta, than meta is mod4. Maybe meta not related to modifiers?
How about we use GDK_META_MASK? That's been there since gtk+ 2.10. Can you try?
Yeah I found just that. Unfotunately doesn't work for me. To be more precise it works only if: 1) Meta is in Mod2 to Mod5 2) There is a modifier which have only Meta keys associated with that. I tested a bit and found that only one of GDK_META_MASK GDK_SUPER_MASK and GDK_HYPER_MASK is used in the keypress event. For me, the default is that Meta is Mod1 :( After changing Meta to Win keys via Gnome's keyboard preferences Mod4 is Meta but it is also Super and I got GDK_SUPER_MASK in the key_press_event :( After changing Mod3 to a separate Meta modifier it works.
So, we need to clear this with gdk and/or xkb first, then switch to GDK_META_MASK. Can you file a bug against gtk+?
Sry, I had an ISP change, and they couldn't solve a trivial problem for a long time. I filed the bug: https://bugzilla.gnome.org/show_bug.cgi?id=603190
Hm. I assume this bug can be reopened now, that bug 603190 has been fixed..?
Fixed. szunti, please help (with recent Gtk+) and report if it actually works. Hope I didn't badly break anyone's terminal.
It broke for me. What used to be Alt-Backspace and Alt-Period in Bash stopped working. I /think/ that I had a default config. But I might be wrong. Should I change the configuration? I don’t understand how. My Xmodmap xmodmap: up to 4 keys per modifier, (keycodes in parentheses): shift Shift_L (0x32), Shift_R (0x3e) lock control Control_L (0x25), Control_R (0x69) mod1 Alt_L (0x40), Meta_L (0xcd) mod2 Num_Lock (0x4d) mod3 mod4 Super_L (0x85), Super_R (0x86), Super_L (0xce), Hyper_L (0xcf) mod5 ISO_Level3_Shift (0x5c), Mode_switch (0xcb) Ubuntu Maverick as of today.
There's also a report here https://bugs.edge.launchpad.net/vte/+bug/619754 which is stating the same, Alt combinations are now broken with latest release.
Ubuntu has reverted commit b73782a to unbreak Alt. This needs more work upstream; anything we can do to help?
Actually I can reproduce. Oops. Somehow I committed this in between changing laptops and ended up not really dogfooding it :(. Reverting.
Reverted. So, the bug here is that most people expect Alt to be sent to terminal apps for meta, without having configured meta. At this point, seems to me that adding API to configure this is the only way to fix this bug. We can then add an option in g-t's Compatibility tab. ChPe?
OK with me. I can handle the g-t side once the vte API is there. Not for 2.32 though, since we're in UI freeze.
Sounds good. Lets leave open then. Will eventually get to it.
> So, the bug here is that most people expect Alt to be sent to terminal apps for > meta, without having configured meta. How does one configure meta? My xmodmap looks the same as belshazzar@gmx.net’s, with Meta_L configured on the same modifier as Alt_L, but with b73782a g-t still wasn’t treating it as Meta.
I see. Ok, I understand what's going on now. Working on a patch.
Pushed to master. Please test and report. commit 724195be5ba53c45d650366a8e029939c20d43a4 Author: Behdad Esfahbod <behdad@behdad.org> Date: Tue Aug 24 16:53:17 2010 -0400 Really fix Bug 601926 - Don't hardcode meta to alt Correct fix applied this time. Tested, Alt is not broken by this change.
724195b works for me. Thanks!
*** Bug 628545 has been marked as a duplicate of this bug. ***