Automatically Managed Hotkeys

Registered by Mikkel Kamstrup Erlandsen

In the 0.3 series an onwards hotkeys are created and implicitly managed only via a hotkey registry. So we remove gtk_hotkey_info_new() and use gtk_hotkey_registry_get_hotkey() to obtain hotkey instances. The registry will save any changes made to the hotkey instances automatically.

Blueprint information

Status:
Started
Approver:
None
Priority:
Essential
Drafter:
None
Direction:
Approved
Assignee:
Mikkel Kamstrup Erlandsen
Definition:
Approved
Series goal:
Accepted for 0.3
Implementation:
Good progress
Milestone target:
milestone icon 0.3.0
Started by
Mikkel Kamstrup Erlandsen

Related branches

Sprints

Whiteboard

So the deal is that the registry should take over the management of the hotkey lifecycle. That way one can not have "unmanaged" hotkeys.

= NEW/MODIFIED METHODS =
Hotkeys are created or looked up with:

/* Lookup or create with default sig. if necessary*/
gtk_hotkey_registry_get_hotkey(const gchar *app_id,
                                                      const gchar *key_id,
                                                      const gchar *default_signature,
                                                      GError *error);

/* Lookup or return NULL if non-existing */
gtk_hotkey_registry_lookup_hotkey(const gchar *app_id,
                                                           const gchar *key_id);

Hotkeys are no longer deleted directly from the registry, but are deleted with a new method on the Hotkey class:

gtk_hotkey_delete();

We need a new signal GtkHotkey::deleted as well. After this signal has been emitted all ops on the hotkey should fail.

/* Set the signature, rebinding the key of already bound */
gtk_hotkey_set_signature(GtkHotkey *hotkey, const gchar *sign, GError *error);

= REMOVED METHODS =
The method gtk_hotkey_registry_delete_hotkey() will be removed from the API. In this fully managed setup we can also remove the method gtk_hotkey_registry_store_hotkey() because storing will be handled under the hood by the registry when setting properties on the hotkey.

As it says in the spec title we will also remove the gtk_hotkey_info_new() method.

(?)

Work Items

Dependency tree

* Blueprints in grey have been implemented.

This blueprint contains Public information 
Everyone can see this information.

Subscribers

No subscribers.