diff options
author | Antonio Ospite <ao2@ao2.it> | 2014-08-11 15:54:07 +0200 |
---|---|---|
committer | Michael Catanzaro <mcatanzaro@igalia.com> | 2016-01-21 14:36:52 -0600 |
commit | 6c4816f6a2792dd6e8ae5f265087b6fd4843b9c7 (patch) | |
tree | 5ac74b1b4b7e80db381aa0c52ab99e4fd3a018c1 /libgnomekbd | |
parent | f3c64c9422a1d026fef38f0326193c6e51ab507a (diff) | |
download | libgnomekbd-6c4816f6a2792dd6e8ae5f265087b6fd4843b9c7.tar.gz |
libgnomekbd/gkbd-keyboard-drawing.c: fix modifier key pressed state
When track_modifiers is true and a modifier key gets pressed, do not
free and reallocate the data and, in particular, do not reallocate
drawing->keys zeroing it; this would result in the modifier keys pressed
states to be forgotten and the modifier keys not to be shown as pressed
when in fact they are (the keyboard symbols reflect the shift level
correctly).
Fix the current situation, allowing the modifier keys pressed state to
be drawn correctly.
https://bugzilla.gnome.org/show_bug.cgi?id=734621
Diffstat (limited to 'libgnomekbd')
-rw-r--r-- | libgnomekbd/gkbd-keyboard-drawing.c | 24 |
1 files changed, 4 insertions, 20 deletions
diff --git a/libgnomekbd/gkbd-keyboard-drawing.c b/libgnomekbd/gkbd-keyboard-drawing.c index 16c2406..6eb4b7c 100644 --- a/libgnomekbd/gkbd-keyboard-drawing.c +++ b/libgnomekbd/gkbd-keyboard-drawing.c @@ -1945,26 +1945,10 @@ xkb_state_notify_event_filter (GdkXEvent * gdkxev, switch (kev->any.xkb_type) { case XkbStateNotify: if (((kev->state.changed & modifier_change_mask) && - drawing->track_modifiers)) { - free_cdik (drawing); - if (drawing->track_modifiers) - gkbd_keyboard_drawing_set_mods - (drawing, - kev->state.compat_state); - drawing->keys = - g_new0 (GkbdKeyboardDrawingKey, - drawing->xkb->max_key_code + - 1); - - gtk_widget_get_allocation (GTK_WIDGET - (drawing), - &allocation); - size_allocate (GTK_WIDGET (drawing), - &allocation, drawing); - - init_keys_and_doodads (drawing); - init_colors (drawing); - } + drawing->track_modifiers)) + gkbd_keyboard_drawing_set_mods + (drawing, + kev->state.compat_state); break; case XkbIndicatorStateNotify: |