aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2014-10-22 14:01:42 +0100
committerPeter Maydell <peter.maydell@linaro.org>2014-10-22 14:01:42 +0100
commit4b4ce6c2b85cadefdd444d9791a96ffdb0377b24 (patch)
tree3103c0ba827bf9bb80e6e05665895e8a74138728
parentad089894a8b203593e1d3f77b54fd5a43dc16c5b (diff)
parent5c960521b8101230bd0d0f5b879e5fd1efdb878b (diff)
Merge remote-tracking branch 'remotes/kraxel/tags/pull-gtk-20141015-1' into staging
gtk: fix memory leak, add pause key support. # gpg: Signature made Wed 15 Oct 2014 11:30:39 BST using RSA key ID D3E87138 # gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>" # gpg: aka "Gerd Hoffmann <gerd@kraxel.org>" # gpg: aka "Gerd Hoffmann (private) <kraxel@gmail.com>" * remotes/kraxel/tags/pull-gtk-20141015-1: gtk: add support for the Pause key gtk.c: Fix memory leak in gd_set_keycode_type() Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
-rw-r--r--ui/gtk.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/ui/gtk.c b/ui/gtk.c
index 2345d7e3a3..8e055da0dc 100644
--- a/ui/gtk.c
+++ b/ui/gtk.c
@@ -931,6 +931,12 @@ static gboolean gd_key_event(GtkWidget *widget, GdkEventKey *key, void *opaque)
int qemu_keycode;
int i;
+ if (key->keyval == GDK_KEY_Pause) {
+ qemu_input_event_send_key_qcode(vc->gfx.dcl.con, Q_KEY_CODE_PAUSE,
+ key->type == GDK_KEY_PRESS);
+ return TRUE;
+ }
+
qemu_keycode = gd_map_keycode(s, gtk_widget_get_display(widget),
gdk_keycode);
@@ -1810,6 +1816,13 @@ static void gd_set_keycode_type(GtkDisplayState *s)
fprintf(stderr, "unknown keycodes `%s', please report to "
"qemu-devel@nongnu.org\n", keycodes);
}
+
+ if (desc) {
+ XkbFreeKeyboard(desc, XkbGBN_AllComponentsMask, True);
+ }
+ if (keycodes) {
+ XFree(keycodes);
+ }
}
#endif
}