[libgnomekbd] libgnomekbd/gkbd-keyboard-drawing.c: fix modifier key pressed state
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgnomekbd] libgnomekbd/gkbd-keyboard-drawing.c: fix modifier key pressed state
- Date: Thu, 21 Jan 2016 20:38:09 +0000 (UTC)
commit 6c4816f6a2792dd6e8ae5f265087b6fd4843b9c7
Author: Antonio Ospite <ao2 ao2 it>
Date: Mon Aug 11 15:54:07 2014 +0200
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
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:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]