diff options
author | Matthias Clasen <mclasen@redhat.com> | 2020-04-05 09:39:03 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2020-04-06 01:40:49 -0400 |
commit | b02db72e17e570ab837f38ac2dfa7345a9824519 (patch) | |
tree | 26b107ae11615e52c358f8504bb5005fd1ccdc4f | |
parent | e8f30c836decfa446b563524cb4a86cca955845c (diff) | |
download | gtk+-b02db72e17e570ab837f38ac2dfa7345a9824519.tar.gz |
Rename GDK_MOD1_MASK to GDK_ALT_MASK
We've hardcoded Mod1 = Alt for a long time, there is
no need to keep the confusing naming around anymore.
34 files changed, 92 insertions, 92 deletions
diff --git a/gdk/broadway/broadway.js b/gdk/broadway/broadway.js index 6cb576d40c..bec7343b97 100644 --- a/gdk/broadway/broadway.js +++ b/gdk/broadway/broadway.js @@ -78,7 +78,7 @@ const GDK_CROSSING_UNGRAB = 2; const GDK_SHIFT_MASK = 1 << 0; const GDK_LOCK_MASK = 1 << 1; const GDK_CONTROL_MASK = 1 << 2; -const GDK_MOD1_MASK = 1 << 3; +const GDK_ALT_MASK = 1 << 3; const GDK_MOD2_MASK = 1 << 4; const GDK_MOD3_MASK = 1 << 5; const GDK_MOD4_MASK = 1 << 6; @@ -1383,13 +1383,13 @@ function updateKeyboardStatus() { } function updateForEvent(ev) { - lastState &= ~(GDK_SHIFT_MASK|GDK_CONTROL_MASK|GDK_MOD1_MASK); + lastState &= ~(GDK_SHIFT_MASK|GDK_CONTROL_MASK|GDK_ALT_MASK); if (ev.shiftKey) lastState |= GDK_SHIFT_MASK; if (ev.ctrlKey) lastState |= GDK_CONTROL_MASK; if (ev.altKey) - lastState |= GDK_MOD1_MASK; + lastState |= GDK_ALT_MASK; lastTimeStamp = ev.timeStamp; } diff --git a/gdk/gdkevents.c b/gdk/gdkevents.c index 5ab593eefb..b2c28b8262 100644 --- a/gdk/gdkevents.c +++ b/gdk/gdkevents.c @@ -2318,7 +2318,7 @@ gdk_event_get_match (GdkEvent *event, accel_mods = gdk_event_get_modifier_state (event); if (accel_key == GDK_KEY_Sys_Req && - (accel_mods & GDK_MOD1_MASK) != 0) + (accel_mods & GDK_ALT_MASK) != 0) { /* HACK: we don't want to use SysRq as a keybinding (but we do * want Alt+Print), so we avoid translation from Alt+Print to SysRq diff --git a/gdk/gdkkeys.c b/gdk/gdkkeys.c index 25e9284e3c..4a908df6ef 100644 --- a/gdk/gdkkeys.c +++ b/gdk/gdkkeys.c @@ -558,7 +558,7 @@ gdk_keymap_lookup_key (GdkKeymap *keymap, * * |[<!-- language="C" --> * // We want to ignore irrelevant modifiers like ScrollLock - * #define ALL_ACCELS_MASK (GDK_CONTROL_MASK | GDK_SHIFT_MASK | GDK_MOD1_MASK) + * #define ALL_ACCELS_MASK (GDK_CONTROL_MASK | GDK_SHIFT_MASK | GDK_ALT_MASK) * state = gdk_event_get_modifier_state (event); * gdk_keymap_translate_keyboard_state (keymap, * gdk_key_event_get_keycode (event), @@ -685,13 +685,13 @@ gdk_keymap_real_get_modifier_mask (GdkKeymap *keymap, return GDK_CONTROL_MASK; case GDK_MODIFIER_INTENT_NO_TEXT_INPUT: - return GDK_MOD1_MASK | GDK_CONTROL_MASK; + return GDK_ALT_MASK | GDK_CONTROL_MASK; case GDK_MODIFIER_INTENT_SHIFT_GROUP: return 0; case GDK_MODIFIER_INTENT_DEFAULT_MOD_MASK: - return (GDK_SHIFT_MASK | GDK_CONTROL_MASK | GDK_MOD1_MASK | + return (GDK_SHIFT_MASK | GDK_CONTROL_MASK | GDK_ALT_MASK | GDK_SUPER_MASK | GDK_HYPER_MASK | GDK_META_MASK); default: @@ -708,7 +708,7 @@ gdk_keymap_real_get_modifier_mask (GdkKeymap *keymap, * uses for a particular purpose. * * Note that this function always returns real hardware modifiers, not - * virtual ones (e.g. it will return #GDK_MOD1_MASK rather than + * virtual ones (e.g. it will return #GDK_ALT_MASK rather than * #GDK_META_MASK if the backend maps MOD1 to META), so there are use * cases where the return value of this function has to be transformed * by gdk_keymap_add_virtual_modifiers() in order to contain the diff --git a/gdk/gdktypes.h b/gdk/gdktypes.h index 69f16c40ed..4c9174388f 100644 --- a/gdk/gdktypes.h +++ b/gdk/gdktypes.h @@ -199,7 +199,7 @@ typedef enum * @GDK_LOCK_MASK: a Lock key (depending on the modifier mapping of the * X server this may either be CapsLock or ShiftLock). * @GDK_CONTROL_MASK: the Control key. - * @GDK_MOD1_MASK: the fourth modifier key (it depends on the modifier + * @GDK_ALT_MASK: the fourth modifier key (it depends on the modifier * mapping of the X server which key is interpreted as this modifier, but * normally it is the Alt key). * @GDK_MOD2_MASK: the fifth modifier key (it depends on the modifier @@ -259,7 +259,7 @@ typedef enum GDK_SHIFT_MASK = 1 << 0, GDK_LOCK_MASK = 1 << 1, GDK_CONTROL_MASK = 1 << 2, - GDK_MOD1_MASK = 1 << 3, + GDK_ALT_MASK = 1 << 3, GDK_MOD2_MASK = 1 << 4, GDK_MOD3_MASK = 1 << 5, GDK_MOD4_MASK = 1 << 6, diff --git a/gdk/quartz/gdkevents-quartz.c b/gdk/quartz/gdkevents-quartz.c index 775e14ba90..49d5cc6aa0 100644 --- a/gdk/quartz/gdkevents-quartz.c +++ b/gdk/quartz/gdkevents-quartz.c @@ -288,7 +288,7 @@ get_keyboard_modifiers_from_ns_flags (NSUInteger nsflags) if (nsflags & NSControlKeyMask) modifiers |= GDK_CONTROL_MASK; if (nsflags & NSAlternateKeyMask) - modifiers |= GDK_MOD1_MASK; + modifiers |= GDK_ALT_MASK; if (nsflags & NSCommandKeyMask) modifiers |= GDK_MOD2_MASK; @@ -1162,7 +1162,7 @@ fill_key_event (GdkSurface *window, break; case GDK_KEY_Alt_R: case GDK_KEY_Alt_L: - mask = GDK_MOD1_MASK; + mask = GDK_ALT_MASK; break; case GDK_KEY_Control_R: case GDK_KEY_Control_L: @@ -1280,7 +1280,7 @@ _gdk_quartz_events_get_current_keyboard_modifiers (void) if (carbon_modifiers & controlKey) modifiers |= GDK_CONTROL_MASK; if (carbon_modifiers & optionKey) - modifiers |= GDK_MOD1_MASK; + modifiers |= GDK_ALT_MASK; if (carbon_modifiers & cmdKey) modifiers |= GDK_MOD2_MASK; diff --git a/gdk/quartz/gdkkeys-quartz.c b/gdk/quartz/gdkkeys-quartz.c index 6ded6b1a34..6237d0d0cc 100644 --- a/gdk/quartz/gdkkeys-quartz.c +++ b/gdk/quartz/gdkkeys-quartz.c @@ -757,10 +757,10 @@ gdk_quartz_keymap_get_modifier_mask (GdkKeymap *keymap, return GDK_MOD2_MASK | GDK_CONTROL_MASK; case GDK_MODIFIER_INTENT_SHIFT_GROUP: - return GDK_MOD1_MASK; + return GDK_ALT_MASK; case GDK_MODIFIER_INTENT_DEFAULT_MOD_MASK: - return (GDK_SHIFT_MASK | GDK_CONTROL_MASK | GDK_MOD1_MASK | + return (GDK_SHIFT_MASK | GDK_CONTROL_MASK | GDK_ALT_MASK | GDK_MOD2_MASK | GDK_SUPER_MASK | GDK_HYPER_MASK | GDK_META_MASK); diff --git a/gdk/wayland/gdkkeys-wayland.c b/gdk/wayland/gdkkeys-wayland.c index b1992057a0..902b9a15b5 100644 --- a/gdk/wayland/gdkkeys-wayland.c +++ b/gdk/wayland/gdkkeys-wayland.c @@ -258,7 +258,7 @@ get_xkb_modifiers (struct xkb_keymap *xkb_keymap, mods |= 1 << xkb_keymap_mod_get_index (xkb_keymap, XKB_MOD_NAME_CAPS); if (state & GDK_CONTROL_MASK) mods |= 1 << xkb_keymap_mod_get_index (xkb_keymap, XKB_MOD_NAME_CTRL); - if (state & GDK_MOD1_MASK) + if (state & GDK_ALT_MASK) mods |= 1 << xkb_keymap_mod_get_index (xkb_keymap, XKB_MOD_NAME_ALT); if (state & GDK_MOD2_MASK) mods |= 1 << xkb_keymap_mod_get_index (xkb_keymap, XKB_MOD_NAME_NUM); @@ -291,7 +291,7 @@ get_gdk_modifiers (struct xkb_keymap *xkb_keymap, if (mods & (1 << xkb_keymap_mod_get_index (xkb_keymap, XKB_MOD_NAME_CTRL))) state |= GDK_CONTROL_MASK; if (mods & (1 << xkb_keymap_mod_get_index (xkb_keymap, XKB_MOD_NAME_ALT))) - state |= GDK_MOD1_MASK; + state |= GDK_ALT_MASK; if (mods & (1 << xkb_keymap_mod_get_index (xkb_keymap, XKB_MOD_NAME_NUM))) state |= GDK_MOD2_MASK; if (mods & (1 << xkb_keymap_mod_get_index (xkb_keymap, "Mod3"))) @@ -310,7 +310,7 @@ get_gdk_modifiers (struct xkb_keymap *xkb_keymap, * rely on that behavior. */ if (mods & (1 << xkb_keymap_mod_get_index (xkb_keymap, "Meta")) && - (state & GDK_MOD1_MASK) == 0) + (state & GDK_ALT_MASK) == 0) state |= GDK_META_MASK; return state; diff --git a/gdk/win32/gdkdevice-win32.c b/gdk/win32/gdkdevice-win32.c index 569e31f499..dffb8d8c7d 100644 --- a/gdk/win32/gdkdevice-win32.c +++ b/gdk/win32/gdkdevice-win32.c @@ -79,7 +79,7 @@ get_current_mask (void) if (kbd[VK_CONTROL] & 0x80) mask |= GDK_CONTROL_MASK; if (kbd[VK_MENU] & 0x80) - mask |= GDK_MOD1_MASK; + mask |= GDK_ALT_MASK; if (kbd[VK_LBUTTON] & 0x80) mask |= GDK_BUTTON1_MASK; if (kbd[VK_MBUTTON] & 0x80) diff --git a/gdk/win32/gdkdevice-wintab.c b/gdk/win32/gdkdevice-wintab.c index 2823a16406..5aed3e053a 100644 --- a/gdk/win32/gdkdevice-wintab.c +++ b/gdk/win32/gdkdevice-wintab.c @@ -54,7 +54,7 @@ get_current_mask (void) if (kbd[VK_CONTROL] & 0x80) mask |= GDK_CONTROL_MASK; if (kbd[VK_MENU] & 0x80) - mask |= GDK_MOD1_MASK; + mask |= GDK_ALT_MASK; if (kbd[VK_LBUTTON] & 0x80) mask |= GDK_BUTTON1_MASK; if (kbd[VK_MBUTTON] & 0x80) diff --git a/gdk/win32/gdkdevicemanager-win32.c b/gdk/win32/gdkdevicemanager-win32.c index 393fe6d7c1..592b52a8d4 100644 --- a/gdk/win32/gdkdevicemanager-win32.c +++ b/gdk/win32/gdkdevicemanager-win32.c @@ -844,7 +844,7 @@ get_modifier_key_state (void) if (GetKeyState (VK_SHIFT) < 0) state |= GDK_SHIFT_MASK; if (GetKeyState (VK_MENU) < 0) - state |= GDK_MOD1_MASK; + state |= GDK_ALT_MASK; if (GetKeyState (VK_CAPITAL) & 0x1) state |= GDK_LOCK_MASK; diff --git a/gdk/win32/gdkdrag-win32.c b/gdk/win32/gdkdrag-win32.c index e16ca9643e..a42a497152 100644 --- a/gdk/win32/gdkdrag-win32.c +++ b/gdk/win32/gdkdrag-win32.c @@ -1869,7 +1869,7 @@ manufacture_keystate_from_GMT (GdkModifierType state) { DWORD key_state = 0; - if (state & GDK_MOD1_MASK) + if (state & GDK_ALT_MASK) key_state |= MK_ALT; if (state & GDK_CONTROL_MASK) key_state |= MK_CONTROL; @@ -2415,22 +2415,22 @@ gdk_dnd_handle_key_event (GdkDrag *drag, case GDK_KEY_Up: case GDK_KEY_KP_Up: - dy = (state & GDK_MOD1_MASK) ? -BIG_STEP : -SMALL_STEP; + dy = (state & GDK_ALT_MASK) ? -BIG_STEP : -SMALL_STEP; break; case GDK_KEY_Down: case GDK_KEY_KP_Down: - dy = (state & GDK_MOD1_MASK) ? BIG_STEP : SMALL_STEP; + dy = (state & GDK_ALT_MASK) ? BIG_STEP : SMALL_STEP; break; case GDK_KEY_Left: case GDK_KEY_KP_Left: - dx = (state & GDK_MOD1_MASK) ? -BIG_STEP : -SMALL_STEP; + dx = (state & GDK_ALT_MASK) ? -BIG_STEP : -SMALL_STEP; break; case GDK_KEY_Right: case GDK_KEY_KP_Right: - dx = (state & GDK_MOD1_MASK) ? BIG_STEP : SMALL_STEP; + dx = (state & GDK_ALT_MASK) ? BIG_STEP : SMALL_STEP; break; } } diff --git a/gdk/win32/gdkevents-win32.c b/gdk/win32/gdkevents-win32.c index b163667a77..fb2867ec83 100644 --- a/gdk/win32/gdkevents-win32.c +++ b/gdk/win32/gdkevents-win32.c @@ -662,14 +662,14 @@ build_key_event_state (BYTE *key_state) if (key_state[VK_RCONTROL] & 0x80) state |= GDK_CONTROL_MASK; if (key_state[VK_LMENU] & 0x80) - state |= GDK_MOD1_MASK; + state |= GDK_ALT_MASK; } else { if (key_state[VK_CONTROL] & 0x80) state |= GDK_CONTROL_MASK; if (key_state[VK_MENU] & 0x80) - state |= GDK_MOD1_MASK; + state |= GDK_ALT_MASK; } return state; @@ -724,7 +724,7 @@ build_pointer_event_state (MSG *msg) state |= GDK_SHIFT_MASK; if (GetKeyState (VK_MENU) < 0) - state |= GDK_MOD1_MASK; + state |= GDK_ALT_MASK; if (GetKeyState (VK_CAPITAL) & 0x1) state |= GDK_LOCK_MASK; @@ -741,7 +741,7 @@ print_event_state (guint state) CASE (SHIFT); CASE (LOCK); CASE (CONTROL); - CASE (MOD1); + CASE (ALT); CASE (MOD2); CASE (MOD3); CASE (MOD4); @@ -2326,9 +2326,9 @@ gdk_event_translate (MSG *msg, both_shift_pressed[0] = both_shift_pressed[1] = 0; } - /* Reset MOD1_MASK if it is the Alt key itself */ + /* Reset ALT_MASK if it is the Alt key itself */ if (msg->wParam == VK_MENU) - state &= ~GDK_MOD1_MASK; + state &= ~GDK_ALT_MASK; event = gdk_event_key_new ((msg->message == WM_KEYDOWN || msg->message == WM_SYSKEYDOWN) ? GDK_KEY_PRESS diff --git a/gdk/x11/gdkdrag-x11.c b/gdk/x11/gdkdrag-x11.c index f2856b891b..6aefc9466a 100644 --- a/gdk/x11/gdkdrag-x11.c +++ b/gdk/x11/gdkdrag-x11.c @@ -2148,7 +2148,7 @@ gdk_drag_get_current_actions (GdkModifierType state, { *possible_actions = actions; - if ((state & (GDK_MOD1_MASK)) && (actions & GDK_ACTION_ASK)) + if ((state & (GDK_ALT_MASK)) && (actions & GDK_ACTION_ASK)) *suggested_action = GDK_ACTION_ASK; else if (actions & GDK_ACTION_COPY) *suggested_action = GDK_ACTION_COPY; @@ -2237,22 +2237,22 @@ gdk_dnd_handle_key_event (GdkDrag *drag, case GDK_KEY_Up: case GDK_KEY_KP_Up: - dy = (state & GDK_MOD1_MASK) ? -BIG_STEP : -SMALL_STEP; + dy = (state & GDK_ALT_MASK) ? -BIG_STEP : -SMALL_STEP; break; case GDK_KEY_Down: case GDK_KEY_KP_Down: - dy = (state & GDK_MOD1_MASK) ? BIG_STEP : SMALL_STEP; + dy = (state & GDK_ALT_MASK) ? BIG_STEP : SMALL_STEP; break; case GDK_KEY_Left: case GDK_KEY_KP_Left: - dx = (state & GDK_MOD1_MASK) ? -BIG_STEP : -SMALL_STEP; + dx = (state & GDK_ALT_MASK) ? -BIG_STEP : -SMALL_STEP; break; case GDK_KEY_Right: case GDK_KEY_KP_Right: - dx = (state & GDK_MOD1_MASK) ? BIG_STEP : SMALL_STEP; + dx = (state & GDK_ALT_MASK) ? BIG_STEP : SMALL_STEP; break; default: diff --git a/gdk/x11/gdkkeys-x11.c b/gdk/x11/gdkkeys-x11.c index 65e40f4bdf..199d600b70 100644 --- a/gdk/x11/gdkkeys-x11.c +++ b/gdk/x11/gdkkeys-x11.c @@ -401,7 +401,7 @@ update_keymaps (GdkX11Keymap *keymap_x11) keymap_x11->modmap[i / keymap_x11->mod_keymap->max_keypermod] |= mask; - /* The fourth modifier, GDK_MOD1_MASK is 1 << 3. + /* The fourth modifier, GDK_ALT_MASK is 1 << 3. * Each group of max_keypermod entries refers to the same modifier. */ mask = 1 << (i / keymap_x11->mod_keymap->max_keypermod); @@ -427,7 +427,7 @@ update_keymaps (GdkX11Keymap *keymap_x11) case GDK_CONTROL_MASK: case GDK_SHIFT_MASK: - case GDK_MOD1_MASK: + case GDK_ALT_MASK: /* Some keyboard maps are known to map Mode_Switch as an * extra Mod1 key. In circumstances like that, it won't be * used to switch groups. diff --git a/gtk/a11y/gtkbuttonaccessible.c b/gtk/a11y/gtkbuttonaccessible.c index 1a2e85e9f2..d296699ee2 100644 --- a/gtk/a11y/gtkbuttonaccessible.c +++ b/gtk/a11y/gtkbuttonaccessible.c @@ -267,7 +267,7 @@ gtk_button_accessible_get_keybinding (AtkAction *action, { key_val = gtk_label_get_mnemonic_keyval (GTK_LABEL (label)); if (key_val != GDK_KEY_VoidSymbol) - return_value = gtk_accelerator_name (key_val, GDK_MOD1_MASK); + return_value = gtk_accelerator_name (key_val, GDK_ALT_MASK); } if (return_value == NULL) { @@ -294,7 +294,7 @@ gtk_button_accessible_get_keybinding (AtkAction *action, { key_val = gtk_label_get_mnemonic_keyval (GTK_LABEL (label)); if (key_val != GDK_KEY_VoidSymbol) - return_value = gtk_accelerator_name (key_val, GDK_MOD1_MASK); + return_value = gtk_accelerator_name (key_val, GDK_ALT_MASK); } } return return_value; diff --git a/gtk/a11y/gtkcomboboxaccessible.c b/gtk/a11y/gtkcomboboxaccessible.c index 1c6b294ab2..b98a71a6f2 100644 --- a/gtk/a11y/gtkcomboboxaccessible.c +++ b/gtk/a11y/gtkcomboboxaccessible.c @@ -287,7 +287,7 @@ gtk_combo_box_accessible_get_keybinding (AtkAction *action, { key_val = gtk_label_get_mnemonic_keyval (GTK_LABEL (label)); if (key_val != GDK_KEY_VoidSymbol) - return_value = gtk_accelerator_name (key_val, GDK_MOD1_MASK); + return_value = gtk_accelerator_name (key_val, GDK_ALT_MASK); } return return_value; diff --git a/gtk/a11y/gtkentryaccessible.c b/gtk/a11y/gtkentryaccessible.c index 01bd1c9ac2..324a79f31c 100644 --- a/gtk/a11y/gtkentryaccessible.c +++ b/gtk/a11y/gtkentryaccessible.c @@ -1533,7 +1533,7 @@ gtk_entry_accessible_get_keybinding (AtkAction *action, { key_val = gtk_label_get_mnemonic_keyval (GTK_LABEL (label)); if (key_val != GDK_KEY_VoidSymbol) - return gtk_accelerator_name (key_val, GDK_MOD1_MASK); + return gtk_accelerator_name (key_val, GDK_ALT_MASK); } return NULL; diff --git a/gtk/a11y/gtkexpanderaccessible.c b/gtk/a11y/gtkexpanderaccessible.c index 6986e50899..d2bd0d9bce 100644 --- a/gtk/a11y/gtkexpanderaccessible.c +++ b/gtk/a11y/gtkexpanderaccessible.c @@ -258,7 +258,7 @@ gtk_expander_accessible_get_keybinding (AtkAction *action, key_val = gtk_label_get_mnemonic_keyval (GTK_LABEL (label)); if (key_val != GDK_KEY_VoidSymbol) - return_value = gtk_accelerator_name (key_val, GDK_MOD1_MASK); + return_value = gtk_accelerator_name (key_val, GDK_ALT_MASK); } return return_value; diff --git a/gtk/a11y/gtktextaccessible.c b/gtk/a11y/gtktextaccessible.c index 4d086b83c7..ea20e4bde1 100644 --- a/gtk/a11y/gtktextaccessible.c +++ b/gtk/a11y/gtktextaccessible.c @@ -963,7 +963,7 @@ gtk_text_accessible_get_keybinding (AtkAction *action, { key_val = gtk_label_get_mnemonic_keyval (GTK_LABEL (label)); if (key_val != GDK_KEY_VoidSymbol) - return gtk_accelerator_name (key_val, GDK_MOD1_MASK); + return gtk_accelerator_name (key_val, GDK_ALT_MASK); } return NULL; diff --git a/gtk/gtkaccelgroup.c b/gtk/gtkaccelgroup.c index 2b544737af..6a1e5a5bec 100644 --- a/gtk/gtkaccelgroup.c +++ b/gtk/gtkaccelgroup.c @@ -338,7 +338,7 @@ gtk_accelerator_parse_with_keycode (const gchar *accelerator, else if (len >= 6 && is_modx (accelerator)) { static const guint mod_vals[] = { - GDK_MOD1_MASK, GDK_MOD2_MASK, GDK_MOD3_MASK, + GDK_ALT_MASK, GDK_MOD2_MASK, GDK_MOD3_MASK, GDK_MOD4_MASK, GDK_MOD5_MASK }; @@ -357,7 +357,7 @@ gtk_accelerator_parse_with_keycode (const gchar *accelerator, { accelerator += 5; len -= 5; - mods |= GDK_MOD1_MASK; + mods |= GDK_ALT_MASK; } else if (len >= 6 && is_meta (accelerator)) { @@ -598,7 +598,7 @@ gtk_accelerator_name (guint accelerator_key, static const gchar text_primary[] = "<Primary>"; static const gchar text_shift[] = "<Shift>"; static const gchar text_control[] = "<Control>"; - static const gchar text_mod1[] = "<Alt>"; + static const gchar text_alt[] = "<Alt>"; static const gchar text_mod2[] = "<Mod2>"; static const gchar text_mod3[] = "<Mod3>"; static const gchar text_mod4[] = "<Mod4>"; @@ -628,8 +628,8 @@ gtk_accelerator_name (guint accelerator_key, l += sizeof (text_shift) - 1; if (accelerator_mods & GDK_CONTROL_MASK) l += sizeof (text_control) - 1; - if (accelerator_mods & GDK_MOD1_MASK) - l += sizeof (text_mod1) - 1; + if (accelerator_mods & GDK_ALT_MASK) + l += sizeof (text_alt) - 1; if (accelerator_mods & GDK_MOD2_MASK) l += sizeof (text_mod2) - 1; if (accelerator_mods & GDK_MOD3_MASK) @@ -667,10 +667,10 @@ gtk_accelerator_name (guint accelerator_key, strcpy (accelerator + l, text_control); l += sizeof (text_control) - 1; } - if (accelerator_mods & GDK_MOD1_MASK) + if (accelerator_mods & GDK_ALT_MASK) { - strcpy (accelerator + l, text_mod1); - l += sizeof (text_mod1) - 1; + strcpy (accelerator + l, text_alt); + l += sizeof (text_alt) - 1; } if (accelerator_mods & GDK_MOD2_MASK) { @@ -945,7 +945,7 @@ gtk_accelerator_print_label (GString *gstring, seen_mod = TRUE; } - if (accelerator_mods & GDK_MOD1_MASK) + if (accelerator_mods & GDK_ALT_MASK) { if (seen_mod) append_separator (gstring); @@ -1098,7 +1098,7 @@ gtk_accelerator_print_label (GString *gstring, * Sets the modifiers that will be considered significant for keyboard * accelerators. The default mod mask depends on the GDK backend in use, * but will typically include #GDK_CONTROL_MASK | #GDK_SHIFT_MASK | - * #GDK_MOD1_MASK | #GDK_SUPER_MASK | #GDK_HYPER_MASK | #GDK_META_MASK. + * #GDK_ALT_MASK | #GDK_SUPER_MASK | #GDK_HYPER_MASK | #GDK_META_MASK. * In other words, Control, Shift, Alt, Super, Hyper and Meta. Other * modifiers will by default be ignored by #GtkAccelGroup. * @@ -1112,7 +1112,7 @@ void gtk_accelerator_set_default_mod_mask (GdkModifierType default_mod_mask) { default_accel_mod_mask = (default_mod_mask & GDK_MODIFIER_MASK) | - (GDK_CONTROL_MASK | GDK_SHIFT_MASK | GDK_MOD1_MASK); + (GDK_CONTROL_MASK | GDK_SHIFT_MASK | GDK_ALT_MASK); } /** @@ -1135,7 +1135,7 @@ gtk_accelerator_get_default_mod_mask (void) display = gdk_display_get_default (); if (!display) - return GDK_CONTROL_MASK | GDK_SHIFT_MASK | GDK_MOD1_MASK; + return GDK_CONTROL_MASK | GDK_SHIFT_MASK | GDK_ALT_MASK; default_accel_mod_mask = gdk_display_get_modifier_mask (display, diff --git a/gtk/gtkapplication-quartz-menu.c b/gtk/gtkapplication-quartz-menu.c index 4a8a135c0e..9b72b8e3c2 100644 --- a/gtk/gtkapplication-quartz-menu.c +++ b/gtk/gtkapplication-quartz-menu.c @@ -346,7 +346,7 @@ icon_loaded (GObject *object, modifiers |= NSShiftKeyMask; if (mask & GDK_CONTROL_MASK) modifiers |= NSControlKeyMask; - if (mask & GDK_MOD1_MASK) + if (mask & GDK_ALT_MASK) modifiers |= NSAlternateKeyMask; if (mask & GDK_META_MASK) modifiers |= NSCommandKeyMask; diff --git a/gtk/gtkcolorplane.c b/gtk/gtkcolorplane.c index a11b0752e2..bbe7ac0f2d 100644 --- a/gtk/gtkcolorplane.c +++ b/gtk/gtkcolorplane.c @@ -321,7 +321,7 @@ key_controller_key_pressed (GtkEventControllerKey *controller, GtkColorPlane *plane = GTK_COLOR_PLANE (widget); gdouble step; - if ((state & GDK_MOD1_MASK) != 0) + if ((state & GDK_ALT_MASK) != 0) step = 0.1; else step = 0.01; diff --git a/gtk/gtkcombobox.c b/gtk/gtkcombobox.c index c1e97debb0..47e3f0cd5b 100644 --- a/gtk/gtkcombobox.c +++ b/gtk/gtkcombobox.c @@ -561,20 +561,20 @@ gtk_combo_box_class_init (GtkComboBoxClass *klass) /* key bindings */ gtk_widget_class_add_binding_signal (widget_class, - GDK_KEY_Down, GDK_MOD1_MASK, + GDK_KEY_Down, GDK_ALT_MASK, "popup", NULL); gtk_widget_class_add_binding_signal (widget_class, - GDK_KEY_KP_Down, GDK_MOD1_MASK, + GDK_KEY_KP_Down, GDK_ALT_MASK, "popup", NULL); gtk_widget_class_add_binding_signal (widget_class, - GDK_KEY_Up, GDK_MOD1_MASK, + GDK_KEY_Up, GDK_ALT_MASK, "popdown", NULL); gtk_widget_class_add_binding_signal (widget_class, - GDK_KEY_KP_Up, GDK_MOD1_MASK, + GDK_KEY_KP_Up, GDK_ALT_MASK, "popdown", NULL); gtk_widget_class_add_binding_signal (widget_class, diff --git a/gtk/gtkfilechooserwidget.c b/gtk/gtkfilechooserwidget.c index f62b861e71..689c8e9eb1 100644 --- a/gtk/gtkfilechooserwidget.c +++ b/gtk/gtkfilechooserwidget.c @@ -7500,29 +7500,29 @@ gtk_file_chooser_widget_class_init (GtkFileChooserWidgetClass *class) NULL); add_normal_and_shifted_binding (widget_class, - GDK_KEY_Up, GDK_MOD1_MASK, + GDK_KEY_Up, GDK_ALT_MASK, "up-folder"); add_normal_and_shifted_binding (widget_class, - GDK_KEY_KP_Up, GDK_MOD1_MASK, + GDK_KEY_KP_Up, GDK_ALT_MASK, "up-folder"); add_normal_and_shifted_binding (widget_class, - GDK_KEY_Down, GDK_MOD1_MASK, + GDK_KEY_Down, GDK_ALT_MASK, "down-folder"); add_normal_and_shifted_binding (widget_class, - GDK_KEY_KP_Down, GDK_MOD1_MASK, + GDK_KEY_KP_Down, GDK_ALT_MASK, "down-folder"); gtk_widget_class_add_binding_signal (widget_class, - GDK_KEY_Home, GDK_MOD1_MASK, + GDK_KEY_Home, GDK_ALT_MASK, "home-folder", NULL); gtk_widget_class_add_binding_signal (widget_class, - GDK_KEY_KP_Home, GDK_MOD1_MASK, + GDK_KEY_KP_Home, GDK_ALT_MASK, "home-folder", NULL); gtk_widget_class_add_binding_signal (widget_class, - GDK_KEY_d, GDK_MOD1_MASK, + GDK_KEY_d, GDK_ALT_MASK, "desktop-folder", NULL); gtk_widget_class_add_binding_signal (widget_class, @@ -7530,7 +7530,7 @@ gtk_file_chooser_widget_class_init (GtkFileChooserWidgetClass *class) "show-hidden", NULL); gtk_widget_class_add_binding_signal (widget_class, - GDK_KEY_s, GDK_MOD1_MASK, + GDK_KEY_s, GDK_ALT_MASK, "search-shortcut", NULL); gtk_widget_class_add_binding_signal (widget_class, @@ -7538,11 +7538,11 @@ gtk_file_chooser_widget_class_init (GtkFileChooserWidgetClass *class) "search-shortcut", NULL); gtk_widget_class_add_binding_signal (widget_class, - GDK_KEY_r, GDK_MOD1_MASK, + GDK_KEY_r, GDK_ALT_MASK, "recent-shortcut", NULL); gtk_widget_class_add_binding_signal (widget_class, - GDK_KEY_p, GDK_MOD1_MASK, + GDK_KEY_p, GDK_ALT_MASK, "places-shortcut", NULL); gtk_widget_class_add_binding (widget_class, @@ -7564,7 +7564,7 @@ gtk_file_chooser_widget_class_init (GtkFileChooserWidgetClass *class) for (i = 0; i < G_N_ELEMENTS (quick_bookmark_keyvals); i++) gtk_widget_class_add_binding_signal (widget_class, - quick_bookmark_keyvals[i], GDK_MOD1_MASK, + quick_bookmark_keyvals[i], GDK_ALT_MASK, "quick-bookmark", "(i)", i); diff --git a/gtk/gtklabel.c b/gtk/gtklabel.c index 9bcdec32e9..2bba929146 100644 --- a/gtk/gtklabel.c +++ b/gtk/gtklabel.c @@ -1090,10 +1090,10 @@ gtk_label_class_init (GtkLabelClass *class) "move-cursor", "(iib)", GTK_MOVEMENT_PARAGRAPH_ENDS, 0, FALSE); - add_move_binding (widget_class, GDK_KEY_f, GDK_MOD1_MASK, + add_move_binding (widget_class, GDK_KEY_f, GDK_ALT_MASK, GTK_MOVEMENT_WORDS, 1); - add_move_binding (widget_class, GDK_KEY_b, GDK_MOD1_MASK, + add_move_binding (widget_class, GDK_KEY_b, GDK_ALT_MASK, GTK_MOVEMENT_WORDS, -1); add_move_binding (widget_class, GDK_KEY_Home, 0, diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c index 3dd45e6535..57f90c8338 100644 --- a/gtk/gtknotebook.c +++ b/gtk/gtknotebook.c @@ -968,11 +968,11 @@ add_reorder_bindings (GtkWidgetClass *widget_class, guint keypad_keysym = keysym - GDK_KEY_Left + GDK_KEY_KP_Left; gtk_widget_class_add_binding_signal (widget_class, - keysym, GDK_MOD1_MASK, + keysym, GDK_ALT_MASK, "reorder_tab", "(ib)", direction, move_to_last); gtk_widget_class_add_binding_signal (widget_class, - keypad_keysym, GDK_MOD1_MASK, + keypad_keysym, GDK_ALT_MASK, "reorder_tab", "(ib)", direction, move_to_last); } @@ -1349,11 +1349,11 @@ gtk_notebook_class_init (GtkNotebookClass *class) "(i)", 1); gtk_widget_class_add_binding_signal (widget_class, - GDK_KEY_Page_Up, GDK_CONTROL_MASK | GDK_MOD1_MASK, + GDK_KEY_Page_Up, GDK_CONTROL_MASK | GDK_ALT_MASK, "change-current-page", "(i)", -1); gtk_widget_class_add_binding_signal (widget_class, - GDK_KEY_Page_Down, GDK_CONTROL_MASK | GDK_MOD1_MASK, + GDK_KEY_Page_Down, GDK_CONTROL_MASK | GDK_ALT_MASK, "change-current-page", "(i)", 1); diff --git a/gtk/gtkplacessidebar.c b/gtk/gtkplacessidebar.c index cdcffab742..934a834762 100644 --- a/gtk/gtkplacessidebar.c +++ b/gtk/gtkplacessidebar.c @@ -3061,7 +3061,7 @@ on_key_pressed (GtkEventControllerKey *controller, } if (keyval == GDK_KEY_Down && - (state & modifiers) == GDK_MOD1_MASK) + (state & modifiers) == GDK_ALT_MASK) return eject_or_unmount_selection (sidebar); if ((keyval == GDK_KEY_Delete || diff --git a/gtk/gtkpopover.c b/gtk/gtkpopover.c index 1c90dc2af9..0f598fa74e 100644 --- a/gtk/gtkpopover.c +++ b/gtk/gtkpopover.c @@ -600,7 +600,7 @@ gtk_popover_has_mnemonic_modifier_pressed (GtkPopover *popover) GdkModifierType mask; gdk_device_get_state (dev, priv->surface, NULL, &mask); - if ((mask & gtk_accelerator_get_default_mod_mask ()) == GDK_MOD1_MASK) + if ((mask & gtk_accelerator_get_default_mod_mask ()) == GDK_ALT_MASK) { retval = TRUE; break; @@ -678,7 +678,7 @@ update_mnemonics_visible (GtkPopover *popover, return; if ((keyval == GDK_KEY_Alt_L || keyval == GDK_KEY_Alt_R) && - ((state & (gtk_accelerator_get_default_mod_mask ()) & ~(GDK_MOD1_MASK)) == 0)) + ((state & (gtk_accelerator_get_default_mod_mask ()) & ~(GDK_ALT_MASK)) == 0)) { if (visible) gtk_popover_schedule_mnemonics_visible (popover); diff --git a/gtk/gtksearchentry.c b/gtk/gtksearchentry.c index 93073e70b7..b8c224dd84 100644 --- a/gtk/gtksearchentry.c +++ b/gtk/gtksearchentry.c @@ -550,7 +550,7 @@ gtk_search_entry_is_keynav (guint keyval, keyval == GDK_KEY_End || keyval == GDK_KEY_KP_End || keyval == GDK_KEY_Page_Up || keyval == GDK_KEY_KP_Page_Up || keyval == GDK_KEY_Page_Down || keyval == GDK_KEY_KP_Page_Down || - ((state & (GDK_CONTROL_MASK | GDK_MOD1_MASK)) != 0)) + ((state & (GDK_CONTROL_MASK | GDK_ALT_MASK)) != 0)) return TRUE; /* Other navigation events should get automatically diff --git a/gtk/gtkshortcutcontroller.c b/gtk/gtkshortcutcontroller.c index 9a817ac286..6398b04831 100644 --- a/gtk/gtkshortcutcontroller.c +++ b/gtk/gtkshortcutcontroller.c @@ -513,7 +513,7 @@ gtk_shortcut_controller_class_init (GtkShortcutControllerClass *klass) P_("Mnemonic modifers"), P_("The modifiers to be pressed to allow mnemonics activation"), GDK_TYPE_MODIFIER_TYPE, - GDK_MOD1_MASK, + GDK_ALT_MASK, G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY | G_PARAM_STATIC_STRINGS); /** @@ -547,7 +547,7 @@ gtk_shortcut_controller_class_init (GtkShortcutControllerClass *klass) static void gtk_shortcut_controller_init (GtkShortcutController *self) { - self->mnemonics_modifiers = GDK_MOD1_MASK; + self->mnemonics_modifiers = GDK_ALT_MASK; } void diff --git a/gtk/gtkshortcutlabel.c b/gtk/gtkshortcutlabel.c index 90471af3ee..6062d9db04 100644 --- a/gtk/gtkshortcutlabel.c +++ b/gtk/gtkshortcutlabel.c @@ -137,7 +137,7 @@ get_labels (guint key, GdkModifierType modifier, guint *n_mods) labels[i++] = C_("keyboard label", "Shift"); if (modifier & GDK_CONTROL_MASK) labels[i++] = C_("keyboard label", "Ctrl"); - if (modifier & GDK_MOD1_MASK) + if (modifier & GDK_ALT_MASK) labels[i++] = C_("keyboard label", "Alt"); if (modifier & GDK_MOD2_MASK) labels[i++] = "Mod2"; diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c index 548034619c..36449aba41 100644 --- a/gtk/gtktreeview.c +++ b/gtk/gtktreeview.c @@ -5348,7 +5348,7 @@ gtk_tree_view_key_controller_key_pressed (GtkEventControllerKey *key, } if (focus_column && - (state & GDK_SHIFT_MASK) && (state & GDK_MOD1_MASK) && + (state & GDK_SHIFT_MASK) && (state & GDK_ALT_MASK) && (keyval == GDK_KEY_Left || keyval == GDK_KEY_KP_Left || keyval == GDK_KEY_Right || keyval == GDK_KEY_KP_Right)) { @@ -5380,7 +5380,7 @@ gtk_tree_view_key_controller_key_pressed (GtkEventControllerKey *key, } if (focus_column && - (state & GDK_MOD1_MASK) && + (state & GDK_ALT_MASK) && (keyval == GDK_KEY_Left || keyval == GDK_KEY_KP_Left || keyval == GDK_KEY_Right || keyval == GDK_KEY_KP_Right || keyval == GDK_KEY_Home || keyval == GDK_KEY_KP_Home diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c index d7a62f52ab..42135b8bb9 100644 --- a/gtk/gtkwindow.c +++ b/gtk/gtkwindow.c @@ -5238,7 +5238,7 @@ gtk_window_has_mnemonic_modifier_pressed (GtkWindow *window) GdkModifierType mask; gdk_device_get_state (dev, priv->surface, NULL, &mask); - if ((mask & gtk_accelerator_get_default_mod_mask ()) == GDK_MOD1_MASK) + if ((mask & gtk_accelerator_get_default_mod_mask ()) == GDK_ALT_MASK) { retval = TRUE; break; @@ -5287,7 +5287,7 @@ update_mnemonics_visible (GtkWindow *window, gboolean visible) { if ((keyval == GDK_KEY_Alt_L || keyval == GDK_KEY_Alt_R) && - ((state & (gtk_accelerator_get_default_mod_mask ()) & ~(GDK_MOD1_MASK)) == 0)) + ((state & (gtk_accelerator_get_default_mod_mask ()) & ~(GDK_ALT_MASK)) == 0)) { if (visible) _gtk_window_schedule_mnemonics_visible (window); diff --git a/testsuite/gtk/shortcuts.c b/testsuite/gtk/shortcuts.c index 5e084b61da..56f3a2d286 100644 --- a/testsuite/gtk/shortcuts.c +++ b/testsuite/gtk/shortcuts.c @@ -171,7 +171,7 @@ test_trigger_parse_keyval (void) guint keyval; int trigger_type; } tests[] = { - { "<Primary><Alt>z", GDK_CONTROL_MASK | GDK_MOD1_MASK, 'z' }, + { "<Primary><Alt>z", GDK_CONTROL_MASK | GDK_ALT_MASK, 'z' }, { "<Control>U", GDK_CONTROL_MASK, 'u' }, { "<Hyper>x", GDK_HYPER_MASK, 'x' }, { "<Meta>y", GDK_META_MASK, 'y' }, |