diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2015-09-09 10:12:20 +0200 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2015-09-15 12:27:39 +0200 |
commit | d531deef119666d4b3605e186a43010782efd899 (patch) | |
tree | 57aedbb22c82cfebfa0009fec0b721eb880daf88 /ui/gtk.c | |
parent | 695cc59d42f2e285abd5cf278bdc07360a995eaa (diff) | |
download | qemu-d531deef119666d4b3605e186a43010782efd899.tar.gz qemu-d531deef119666d4b3605e186a43010782efd899.tar.bz2 qemu-d531deef119666d4b3605e186a43010782efd899.zip |
gtk: trace input grab reason
Add a reason to grab calls and trace points,
so it is easier to debug grab related ui issues.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Diffstat (limited to 'ui/gtk.c')
-rw-r--r-- | ui/gtk.c | 26 |
1 files changed, 13 insertions, 13 deletions
@@ -165,9 +165,9 @@ struct GtkDisplayState { bool ignore_keys; }; -static void gd_grab_pointer(VirtualConsole *vc); +static void gd_grab_pointer(VirtualConsole *vc, const char *reason); static void gd_ungrab_pointer(GtkDisplayState *s); -static void gd_grab_keyboard(VirtualConsole *vc); +static void gd_grab_keyboard(VirtualConsole *vc, const char *reason); static void gd_ungrab_keyboard(GtkDisplayState *s); /** Utility Functions **/ @@ -855,7 +855,7 @@ static gboolean gd_button_event(GtkWidget *widget, GdkEventButton *button, gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(s->grab_item), TRUE); } else { - gd_grab_pointer(vc); + gd_grab_pointer(vc, "relative-mode-click"); } return TRUE; } @@ -1092,7 +1092,7 @@ static gboolean gd_win_grab(void *opaque) if (vc->s->ptr_owner) { gd_ungrab_pointer(vc->s); } else { - gd_grab_pointer(vc); + gd_grab_pointer(vc, "user-request-detached-tab"); } return TRUE; } @@ -1256,7 +1256,7 @@ static void gd_grab_devices(VirtualConsole *vc, bool grab, } #endif -static void gd_grab_keyboard(VirtualConsole *vc) +static void gd_grab_keyboard(VirtualConsole *vc, const char *reason) { if (vc->s->kbd_owner) { if (vc->s->kbd_owner == vc) { @@ -1277,7 +1277,7 @@ static void gd_grab_keyboard(VirtualConsole *vc) #endif vc->s->kbd_owner = vc; gd_update_caption(vc->s); - trace_gd_grab(vc->label, "kbd", true); + trace_gd_grab(vc->label, "kbd", reason); } static void gd_ungrab_keyboard(GtkDisplayState *s) @@ -1295,10 +1295,10 @@ static void gd_ungrab_keyboard(GtkDisplayState *s) gdk_keyboard_ungrab(GDK_CURRENT_TIME); #endif gd_update_caption(s); - trace_gd_grab(vc->label, "kbd", false); + trace_gd_ungrab(vc->label, "kbd"); } -static void gd_grab_pointer(VirtualConsole *vc) +static void gd_grab_pointer(VirtualConsole *vc, const char *reason) { GdkDisplay *display = gtk_widget_get_display(vc->gfx.drawing_area); @@ -1337,7 +1337,7 @@ static void gd_grab_pointer(VirtualConsole *vc) #endif vc->s->ptr_owner = vc; gd_update_caption(vc->s); - trace_gd_grab(vc->label, "ptr", true); + trace_gd_grab(vc->label, "ptr", reason); } static void gd_ungrab_pointer(GtkDisplayState *s) @@ -1363,7 +1363,7 @@ static void gd_ungrab_pointer(GtkDisplayState *s) vc->s->grab_x_root, vc->s->grab_y_root); #endif gd_update_caption(s); - trace_gd_grab(vc->label, "ptr", false); + trace_gd_ungrab(vc->label, "ptr"); } static void gd_menu_grab_input(GtkMenuItem *item, void *opaque) @@ -1372,8 +1372,8 @@ static void gd_menu_grab_input(GtkMenuItem *item, void *opaque) VirtualConsole *vc = gd_vc_find_current(s); if (gd_is_grab_active(s)) { - gd_grab_keyboard(vc); - gd_grab_pointer(vc); + gd_grab_keyboard(vc, "user-request-main-window"); + gd_grab_pointer(vc, "user-request-main-window"); } else { gd_ungrab_keyboard(s); gd_ungrab_pointer(s); @@ -1432,7 +1432,7 @@ static gboolean gd_enter_event(GtkWidget *widget, GdkEventCrossing *crossing, GtkDisplayState *s = vc->s; if (gd_grab_on_hover(s)) { - gd_grab_keyboard(vc); + gd_grab_keyboard(vc, "grab-on-hover"); } return TRUE; } |