[vte/vte-next] keymap: Treat ALT as META



commit bf61beb4544bdb8526bf51a47ed943aea40d64af
Author: Christian Persch <chpe gnome org>
Date:   Sat May 12 18:48:05 2012 +0200

    keymap: Treat ALT as META
    
    https://bugzilla.gnome.org/show_bug.cgi?id=663779
    (cherry picked from commit a9d6a34708f846952f423d078397352858f7b1a4)
    
    Conflicts:
    
    	src/vte.c

 src/vte.c |   21 +++++++++++++++------
 1 files changed, 15 insertions(+), 6 deletions(-)
---
diff --git a/src/vte.c b/src/vte.c
index 3cad457..72eb5bf 100644
--- a/src/vte.c
+++ b/src/vte.c
@@ -4779,15 +4779,24 @@ static void
 vte_view_read_modifiers (VteView *terminal,
 			     GdkEvent *event)
 {
+        GdkKeymap *keymap;
 	GdkModifierType modifiers;
 
 	/* Read the modifiers. */
-	if (gdk_event_get_state((GdkEvent*)event, &modifiers)) {
-		GdkKeymap *keymap;
-                keymap = gdk_keymap_get_for_display(gdk_window_get_display(((GdkEventAny*)event)->window));
-                gdk_keymap_add_virtual_modifiers (keymap, &modifiers);
-		terminal->pvt->modifiers = modifiers;
-	}
+	if (!gdk_event_get_state((GdkEvent*)event, &modifiers))
+                return;
+
+        keymap = gdk_keymap_get_for_display(gdk_window_get_display(((GdkEventAny*)event)->window));
+
+        gdk_keymap_add_virtual_modifiers (keymap, &modifiers);
+
+#if 1
+        /* HACK! Treat ALT as META; see bug #663779. */
+        if (modifiers & GDK_MOD1_MASK)
+                modifiers |= VTE_META_MASK;
+#endif
+
+        terminal->pvt->modifiers = modifiers;
 }
 
 /* Read and handle a keypress event. */



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]