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 601926 - Don't hardcode meta to alt
Don't hardcode meta to alt
Status: RESOLVED FIXED
Product: vte
Classification: Core
Component: general
unspecified
Other Linux
: Low enhancement
: ---
Assigned To: VTE Maintainers
VTE Maintainers
API
: 628545 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2009-11-14 22:26 UTC by szunti
Modified: 2010-09-02 18:47 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description szunti 2009-11-14 22:26:06 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.
Comment 1 Behdad Esfahbod 2009-11-15 23:40:34 UTC
Why do you think so?
Comment 2 szunti 2009-11-16 13:26:25 UTC
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.
Comment 3 szunti 2009-11-16 14:16:43 UTC
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?
Comment 4 Behdad Esfahbod 2009-11-16 17:49:36 UTC
How about we use GDK_META_MASK?  That's been there since gtk+ 2.10.  Can you try?
Comment 5 szunti 2009-11-16 18:03:06 UTC
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.
Comment 6 Behdad Esfahbod 2009-11-16 18:08:50 UTC
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+?
Comment 7 szunti 2009-11-27 23:04:15 UTC
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
Comment 8 Tobias Mueller 2010-06-04 11:54:47 UTC
Hm. I assume this bug can be reopened now, that bug 603190 has been fixed..?
Comment 9 Behdad Esfahbod 2010-06-04 18:39:05 UTC
Fixed.  szunti, please help (with recent Gtk+) and report if it actually works.  Hope I didn't badly break anyone's terminal.
Comment 10 Tobias Wolf 2010-08-18 13:18:52 UTC
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.
Comment 11 Pedro Villavicencio 2010-08-18 14:36:26 UTC
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.
Comment 12 Anders Kaseorg 2010-08-19 03:34:25 UTC
Ubuntu has reverted commit b73782a to unbreak Alt.  This needs more work upstream; anything we can do to help?
Comment 13 Behdad Esfahbod 2010-08-19 16:50:37 UTC
Actually I can reproduce.  Oops.  Somehow I committed this in between changing laptops and ended up not really dogfooding it :(.  Reverting.
Comment 14 Behdad Esfahbod 2010-08-19 16:54:33 UTC
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?
Comment 15 Christian Persch 2010-08-19 17:26:09 UTC
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.
Comment 16 Behdad Esfahbod 2010-08-19 17:53:34 UTC
Sounds good.  Lets leave open then.  Will eventually get to it.
Comment 17 Anders Kaseorg 2010-08-21 18:08:31 UTC
> 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.
Comment 18 Behdad Esfahbod 2010-08-24 20:45:47 UTC
I see.  Ok, I understand what's going on now.  Working on a patch.
Comment 19 Behdad Esfahbod 2010-08-24 21:35:32 UTC
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.
Comment 20 Anders Kaseorg 2010-08-26 01:59:07 UTC
724195b works for me.  Thanks!
Comment 21 Christian Persch 2010-09-02 18:47:05 UTC
*** Bug 628545 has been marked as a duplicate of this bug. ***