mirror of
https://github.com/brl/mutter.git
synced 2024-12-23 19:42:05 +00:00
keybindings: Add flag param to grab_accelerator
Add a 'flags' parameters to meta_display_grab_accelerator. This will allow e.g. gnome-settings-daemon (through the gnome-shell's GrabAccelerator API) to create shorcuts that should descard auto-repeated key events. https://gitlab.gnome.org/GNOME/mutter/merge_requests/169 Closes: https://gitlab.gnome.org/GNOME/gnome-settings-daemon/issues/68
This commit is contained in:
parent
5688f1cf6e
commit
00ca387ec7
@ -1593,8 +1593,9 @@ handle_external_grab (MetaDisplay *display,
|
|||||||
|
|
||||||
|
|
||||||
guint
|
guint
|
||||||
meta_display_grab_accelerator (MetaDisplay *display,
|
meta_display_grab_accelerator (MetaDisplay *display,
|
||||||
const char *accelerator)
|
const char *accelerator,
|
||||||
|
MetaKeyBindingFlags flags)
|
||||||
{
|
{
|
||||||
MetaKeyBindingManager *keys = &display->key_binding_manager;
|
MetaKeyBindingManager *keys = &display->key_binding_manager;
|
||||||
MetaKeyBinding *binding;
|
MetaKeyBinding *binding;
|
||||||
@ -1636,6 +1637,7 @@ meta_display_grab_accelerator (MetaDisplay *display,
|
|||||||
binding->handler = HANDLER ("external-grab");
|
binding->handler = HANDLER ("external-grab");
|
||||||
binding->combo = combo;
|
binding->combo = combo;
|
||||||
binding->resolved_combo = resolved_combo;
|
binding->resolved_combo = resolved_combo;
|
||||||
|
binding->flags = flags;
|
||||||
|
|
||||||
g_hash_table_add (keys->key_bindings, binding);
|
g_hash_table_add (keys->key_bindings, binding);
|
||||||
index_binding (keys, binding);
|
index_binding (keys, binding);
|
||||||
|
@ -157,8 +157,9 @@ gboolean meta_display_remove_keybinding (MetaDisplay *display,
|
|||||||
const char *name);
|
const char *name);
|
||||||
|
|
||||||
META_EXPORT
|
META_EXPORT
|
||||||
guint meta_display_grab_accelerator (MetaDisplay *display,
|
guint meta_display_grab_accelerator (MetaDisplay *display,
|
||||||
const char *accelerator);
|
const char *accelerator,
|
||||||
|
MetaKeyBindingFlags flags);
|
||||||
|
|
||||||
META_EXPORT
|
META_EXPORT
|
||||||
gboolean meta_display_ungrab_accelerator (MetaDisplay *display,
|
gboolean meta_display_ungrab_accelerator (MetaDisplay *display,
|
||||||
|
Loading…
Reference in New Issue
Block a user