diff options
author | Matthias Clasen <mclasen@redhat.com> | 2020-04-05 20:39:04 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2020-04-06 16:32:03 -0400 |
commit | 14be8f6b73535e5d599900c2e476f487ceab4b94 (patch) | |
tree | dda7a1b51e5f5c7d62e132a66b877a94b8774f23 /gdk | |
parent | 99a344f791436f529cd54a2412852fec3f5c200e (diff) | |
download | gtk+-14be8f6b73535e5d599900c2e476f487ceab4b94.tar.gz |
Remove uses of modifier intents in gdkevents.c
This removes the use of the context menu and shift group
intents in gdkevents.c. If it turns out to be important,
we need to introduce vfuncs for gdk_event_triggers_context_menu
and gdk_event_matches.
Diffstat (limited to 'gdk')
-rw-r--r-- | gdk/gdkevents.c | 35 |
1 files changed, 9 insertions, 26 deletions
diff --git a/gdk/gdkevents.c b/gdk/gdkevents.c index 1e16dde660..e99b95a3cd 100644 --- a/gdk/gdkevents.c +++ b/gdk/gdkevents.c @@ -552,10 +552,7 @@ gdk_event_get_axis (GdkEvent *event, * * This function returns whether a #GdkEventButton should trigger a * context menu, according to platform conventions. The right mouse - * button always triggers context menus. Additionally, if - * gdk_keymap_get_modifier_mask() returns a non-0 mask for - * %GDK_MODIFIER_INTENT_CONTEXT_MENU, then the left mouse button will - * also trigger a context menu if this modifier is pressed. + * button always triggers context menus. * * This function should always be used instead of simply checking for * event->button == %GDK_BUTTON_SECONDARY. @@ -570,25 +567,12 @@ gdk_event_triggers_context_menu (GdkEvent *event) if (event->any.type == GDK_BUTTON_PRESS) { GdkEventButton *bevent = (GdkEventButton *) event; - GdkDisplay *display; - GdkModifierType modifier; g_return_val_if_fail (GDK_IS_SURFACE (bevent->any.surface), FALSE); if (bevent->button == GDK_BUTTON_SECONDARY && ! (bevent->state & (GDK_BUTTON1_MASK | GDK_BUTTON2_MASK))) return TRUE; - - display = gdk_surface_get_display (bevent->any.surface); - - modifier = gdk_keymap_get_modifier_mask (gdk_display_get_keymap (display), - GDK_MODIFIER_INTENT_CONTEXT_MENU); - - if (modifier != 0 && - bevent->button == GDK_BUTTON_PRIMARY && - ! (bevent->state & (GDK_BUTTON2_MASK | GDK_BUTTON3_MASK)) && - (bevent->state & modifier)) - return TRUE; } return FALSE; @@ -2166,14 +2150,16 @@ gdk_key_event_matches (GdkEvent *event, level = event->key.translated[1].level; consumed_modifiers = event->key.translated[1].consumed; - mask = gdk_keymap_get_modifier_mask (keymap, - GDK_MODIFIER_INTENT_DEFAULT_MOD_MASK); + mask = GDK_CONTROL_MASK|GDK_SHIFT_MASK|GDK_ALT_MASK| + GDK_SUPER_MASK|GDK_HYPER_MASK|GDK_META_MASK; /* if the group-toggling modifier is part of the default accel mod * mask, and it is active, disable it for matching + * + * FIXME: get shift group mask from backends */ - shift_group_mask = gdk_keymap_get_modifier_mask (keymap, - GDK_MODIFIER_INTENT_SHIFT_GROUP); + shift_group_mask = 0; + if (mask & shift_group_mask) group_mod_is_accel_mod = TRUE; @@ -2243,7 +2229,6 @@ gdk_key_event_get_match (GdkEvent *event, guint *keyval, GdkModifierType *modifiers) { - GdkKeymap *keymap; GdkModifierType mask; guint key; guint accel_key; @@ -2253,10 +2238,8 @@ gdk_key_event_get_match (GdkEvent *event, g_return_val_if_fail (event->any.type == GDK_KEY_PRESS || event->any.type == GDK_KEY_RELEASE, FALSE); - keymap = gdk_display_get_keymap (gdk_event_get_display (event)); - - mask = gdk_keymap_get_modifier_mask (keymap, - GDK_MODIFIER_INTENT_DEFAULT_MOD_MASK); + mask = GDK_CONTROL_MASK|GDK_SHIFT_MASK|GDK_ALT_MASK| + GDK_SUPER_MASK|GDK_HYPER_MASK|GDK_META_MASK; accel_key = event->key.translated[1].keyval; accel_mods = event->key.state; |