Keyboard shortcuts editor should allow setting conflicting keybindings sometimes
See for example:
<Control>O
is set to unminimize windows in window icon mode, and also open files in file icon mode. The only reason this is currently set that way is because I've set those as the defaults in the XfceGtkActionEntry
structs; if I try to change one of them to something else and then change it back, the editor will give me an error saying the shortcut is already used.
It would be nice to have a way to mark groups of shortcut sections that are independent of each other, and can overlap. But not all of them: for example, I have four categories: Desktop, Icons, Window Icons, and File Icons. Window Icons and File Icons should be allowed to have overlapping shortcuts, but the combinations of Desktop+Icons+Window Icons and Desktop+Icons+File Icons should not. An API like this on creation might work:
GtkWidget *xfce_shortcuts_editor_new_with_groups(XfceShortcutsEditorSection *sections,
gsize n_sections,
GList *first_group, // list of XfceShortcutsEditorSection*
...) G_GNUC_NULL_TERMINATED;
And I would use it like this:
XfceShortcutsEditorSection sections[4] = {
{ /* Set up Desktop section */ },
{ /* Set up Icons section */ },
{ /* Set up Window Icons section */ },
{ /* Set up File Icons section */ },
};
GList *window_icons_group = g_list_append(NULL, §ions[0]);
window_icons_group = g_list_append(window_icons_group, §ions[1]);
window_icons_group = g_list_append(window_icons_group, §ions[2]);
GList *file_icons_group = g_list_append(NULL, §ions[0]);
file_icons_group = g_list_append(file_icons_group, §ions[1]);
file_icons_group = g_list_append(file_icons_group, §ions[3]);
GtkWidget *editor = xfce_shortcuts_editor_new_with_groups(sections,
G_N_ELEMENTS(sections),
window_icons_group,
file_icons_group,
NULL);
g_list_free(window_icons_group);
g_list_free(file_icons_group);
The existing APIs would behave the same as they are, and act as if there was one group that contains all passed sections.