aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2014-05-06 10:43:52 +0200
committerGerd Hoffmann <kraxel@redhat.com>2014-05-26 08:41:03 +0200
commit1c856da57b29e41c73701f6f798589d50274b368 (patch)
tree31a20d5571c15f31d7a61ab55e4c1a201c53b46f
parent74444bc1983bfe4cea794a5b4f2e6bc7ea5552ed (diff)
downloadqemu-1c856da57b29e41c73701f6f798589d50274b368.zip
qemu-1c856da57b29e41c73701f6f798589d50274b368.tar.gz
qemu-1c856da57b29e41c73701f6f798589d50274b368.tar.bz2
gtk: add gd_grab trace event
Input grab code is tricky, add some debug & trouble shooting aid. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
-rw-r--r--trace-events1
-rw-r--r--ui/gtk.c4
2 files changed, 5 insertions, 0 deletions
diff --git a/trace-events b/trace-events
index 3a41abf..aaaae42 100644
--- a/trace-events
+++ b/trace-events
@@ -1048,6 +1048,7 @@ ppm_save(const char *filename, void *display_surface) "%s surface=%p"
gd_switch(const char *tab, int width, int height) "tab=%s, width=%d, height=%d"
gd_update(const char *tab, int x, int y, int w, int h) "tab=%s, x=%d, y=%d, w=%d, h=%d"
gd_key_event(const char *tab, int gdk_keycode, int qemu_keycode, const char *action) "tab=%s, translated GDK keycode %d to QEMU keycode %d (%s)"
+gd_grab(const char *tab, const char *device, bool on) "tab=%s, %s %d"
# ui/input.c
input_event_key_number(int conidx, int number, bool down) "con %d, key number 0x%x, down %d"
diff --git a/ui/gtk.c b/ui/gtk.c
index 3ee9465..0e35abf 100644
--- a/ui/gtk.c
+++ b/ui/gtk.c
@@ -1058,6 +1058,7 @@ static void gd_grab_keyboard(VirtualConsole *vc)
FALSE,
GDK_CURRENT_TIME);
#endif
+ trace_gd_grab(vc->label, "kbd", true);
}
static void gd_ungrab_keyboard(VirtualConsole *vc)
@@ -1080,6 +1081,7 @@ static void gd_ungrab_keyboard(VirtualConsole *vc)
#else
gdk_keyboard_ungrab(GDK_CURRENT_TIME);
#endif
+ trace_gd_grab(vc->label, "kbd", false);
}
static void gd_grab_pointer(VirtualConsole *vc)
@@ -1125,6 +1127,7 @@ static void gd_grab_pointer(VirtualConsole *vc)
gdk_display_get_pointer(display, NULL,
&vc->s->grab_x_root, &vc->s->grab_y_root, NULL);
#endif
+ trace_gd_grab(vc->label, "ptr", true);
}
static void gd_ungrab_pointer(VirtualConsole *vc)
@@ -1153,6 +1156,7 @@ static void gd_ungrab_pointer(VirtualConsole *vc)
gtk_widget_get_screen(vc->gfx.drawing_area),
vc->s->grab_x_root, vc->s->grab_y_root);
#endif
+ trace_gd_grab(vc->label, "ptr", false);
}
static void gd_menu_grab_input(GtkMenuItem *item, void *opaque)