mirror of
https://github.com/brl/mutter.git
synced 2024-11-21 23:50:41 -05:00
Add meta_key_binding_is_reversed()
MetaKeyBinding can be marked as being reversed (META_KEY_BINDING_IS_REVERSED), but MetaKeyHandlerFunc callbacks cannot check whether this flag was set or not on the MetaKeyBinding which triggered the callback. https://bugzilla.gnome.org/show_bug.cgi?id=732295
This commit is contained in:
parent
6acf7b06f4
commit
c5c6b2257f
@ -101,6 +101,12 @@ meta_key_binding_get_modifiers (MetaKeyBinding *binding)
|
||||
return binding->modifiers;
|
||||
}
|
||||
|
||||
gboolean
|
||||
meta_key_binding_is_reversed (MetaKeyBinding *binding)
|
||||
{
|
||||
return (binding->handler->flags & META_KEY_BINDING_IS_REVERSED) != 0;
|
||||
}
|
||||
|
||||
guint
|
||||
meta_key_binding_get_mask (MetaKeyBinding *binding)
|
||||
{
|
||||
@ -2970,7 +2976,7 @@ handle_switch (MetaDisplay *display,
|
||||
MetaKeyBinding *binding,
|
||||
gpointer dummy)
|
||||
{
|
||||
gint backwards = (binding->handler->flags & META_KEY_BINDING_IS_REVERSED) != 0;
|
||||
gboolean backwards = meta_key_binding_is_reversed (binding);
|
||||
do_choose_window (display, screen, event_window, event, binding, backwards);
|
||||
}
|
||||
|
||||
@ -2982,7 +2988,7 @@ handle_cycle (MetaDisplay *display,
|
||||
MetaKeyBinding *binding,
|
||||
gpointer dummy)
|
||||
{
|
||||
gint backwards = (binding->handler->flags & META_KEY_BINDING_IS_REVERSED) != 0;
|
||||
gboolean backwards = meta_key_binding_is_reversed (binding);
|
||||
do_choose_window (display, screen, event_window, event, binding, backwards);
|
||||
}
|
||||
|
||||
|
@ -27,6 +27,8 @@ const char *meta_key_binding_get_name (MetaKeyBinding *binding);
|
||||
MetaVirtualModifier meta_key_binding_get_modifiers (MetaKeyBinding *binding);
|
||||
guint meta_key_binding_get_mask (MetaKeyBinding *binding);
|
||||
gboolean meta_key_binding_is_builtin (MetaKeyBinding *binding);
|
||||
gboolean meta_key_binding_is_reversed (MetaKeyBinding *binding);
|
||||
|
||||
|
||||
gboolean meta_keybindings_set_custom_handler (const gchar *name,
|
||||
MetaKeyHandlerFunc handler,
|
||||
|
Loading…
Reference in New Issue
Block a user