ui/gtk: Add gd_motion_event trace event
authorhikalium <hikalium@hikalium.com>
Sun, 12 May 2024 11:14:34 +0000 (20:14 +0900)
committerMarc-André Lureau <marcandre.lureau@redhat.com>
Tue, 14 May 2024 13:14:13 +0000 (17:14 +0400)
Add gd_motion_event trace event for making it easy to debug
gd_motion_event related issues.

Signed-off-by: hikalium <hikalium@hikalium.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20240512111435.30121-2-hikalium@hikalium.com>

ui/gtk.c
ui/trace-events

index 3a6832eb1b05c0d1a680835bbc4a5e5c8169b391..7ce73b0798dc9bdf0c887573ce4e434e5ceb5c72 100644 (file)
--- a/ui/gtk.c
+++ b/ui/gtk.c
@@ -915,6 +915,8 @@ static gboolean gd_motion_event(GtkWidget *widget, GdkEventMotion *motion,
     x = (motion->x - mx) / vc->gfx.scale_x * ws;
     y = (motion->y - my) / vc->gfx.scale_y * ws;
 
+    trace_gd_motion_event(ww, wh, gtk_widget_get_scale_factor(widget), x, y);
+
     if (qemu_input_is_absolute(vc->gfx.dcl.con)) {
         if (x < 0 || y < 0 ||
             x >= surface_width(vc->gfx.ds) ||
index e6a28943036eb05cf9b17dd718fe73c3cf96a5e2..69ff22955d1d23b5dacecc7fed64357fd0b035a1 100644 (file)
@@ -28,6 +28,7 @@ gd_ungrab(const char *tab, const char *device) "tab=%s, dev=%s"
 gd_keymap_windowing(const char *name) "backend=%s"
 gd_gl_area_create_context(void *ctx, int major, int minor) "ctx=%p, major=%d, minor=%d"
 gd_gl_area_destroy_context(void *ctx, void *current_ctx) "ctx=%p, current_ctx=%p"
+gd_motion_event(int ww, int wh, int ws, int x, int y) "ww=%d, wh=%d, ws=%d, x=%d, y=%d"
 
 # vnc-auth-sasl.c
 # vnc-auth-vencrypt.c