Skip to content
Snippets Groups Projects
Commit 34a7ee18 authored by Julien Bonjean's avatar Julien Bonjean
Browse files

[#2916] Fixed hashmap update for shortcuts

parent 8a1ae9bb
No related branches found
No related tags found
No related merge requests found
......@@ -59,7 +59,8 @@ popup_window_callback()
{
gtk_widget_hide (GTK_WIDGET(get_main_window()));
gtk_widget_show (GTK_WIDGET(get_main_window()));
gtk_window_move (GTK_WINDOW (get_main_window ()), dbus_get_window_position_x (), dbus_get_window_position_y ());
gtk_window_move (GTK_WINDOW (get_main_window ()),
dbus_get_window_position_x (), dbus_get_window_position_y ());
}
static void
......@@ -143,10 +144,6 @@ create_bindings()
{
if (accelerators_list[i].value != 0)
{
// update value in hashtable (used for dbus calls)
g_hash_table_replace(shortcutsMap, g_strdup(accelerators_list[i].action),
GINT_TO_POINTER(accelerators_list[i].value));
// updated GDK bindings
for (j = 0; j < gdk_display_get_n_screens (display); j++)
{
......@@ -160,6 +157,7 @@ create_bindings()
}
}
}
i++;
}
}
......@@ -202,7 +200,8 @@ initialize_accelerators_list()
{
GList* shortcutsKeys = g_hash_table_get_keys (shortcutsMap);
accelerators_list = (Accelerator*)malloc((g_list_length(shortcutsKeys) + 1) *sizeof(Accelerator));
accelerators_list = (Accelerator*) malloc (
(g_list_length (shortcutsKeys) + 1) * sizeof(Accelerator));
GList* shortcutsKeysElement;
int index = 0;
......@@ -242,6 +241,11 @@ shortcuts_update_bindings(const guint index, const guint code)
// store new value
accelerators_list[index].value = code;
// update value in hashtable (used for dbus calls)
g_hash_table_replace (shortcutsMap,
g_strdup (accelerators_list[index].action), GINT_TO_POINTER (
accelerators_list[index].value));
// recreate all bindings
create_bindings ();
......@@ -353,9 +357,12 @@ ungrab_key(int key_code, GdkWindow *root)
XUngrabKey (GDK_DISPLAY(), key_code, Mod2Mask, GDK_WINDOW_XID(root));
XUngrabKey (GDK_DISPLAY(), key_code, Mod5Mask, GDK_WINDOW_XID(root));
XUngrabKey (GDK_DISPLAY(), key_code, LockMask, GDK_WINDOW_XID(root));
XUngrabKey(GDK_DISPLAY(), key_code, Mod2Mask | Mod5Mask, GDK_WINDOW_XID(root));
XUngrabKey(GDK_DISPLAY(), key_code, Mod2Mask | LockMask, GDK_WINDOW_XID(root));
XUngrabKey(GDK_DISPLAY(), key_code, Mod5Mask | LockMask, GDK_WINDOW_XID(root));
XUngrabKey (GDK_DISPLAY(), key_code, Mod2Mask | Mod5Mask,
GDK_WINDOW_XID(root));
XUngrabKey (GDK_DISPLAY(), key_code, Mod2Mask | LockMask,
GDK_WINDOW_XID(root));
XUngrabKey (GDK_DISPLAY(), key_code, Mod5Mask | LockMask,
GDK_WINDOW_XID(root));
XUngrabKey (GDK_DISPLAY(), key_code, Mod2Mask | Mod5Mask | LockMask,
GDK_WINDOW_XID(root));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment