diff mbox series

[1/3] This reverts commit f14aab420c58b57e07189d6d9e6d3fbfab4761a6.

Message ID 20230220101342.129689-1-liuyujun@fingera.cn
State New
Headers show
Series [1/3] This reverts commit f14aab420c58b57e07189d6d9e6d3fbfab4761a6. | expand

Commit Message

liuyujun Feb. 20, 2023, 10:13 a.m. UTC
This commit was originally tested on gtk/gl which corrected behavior
there. Turns out, the OpenGL texture representing the virtual console
was being rendered in the incorrect place and not that the cursor
was incorrectly being handled.

Signed-off-by: Alexander Orzechowski <orzechowski.alexander@gmail.com>
Signed-off-by: Yujun <liuyujun@fingera.cn>
---
 ui/gtk.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/ui/gtk.c b/ui/gtk.c
index 7f752d8b7d..0b4713fcd5 100644
--- a/ui/gtk.c
+++ b/ui/gtk.c
@@ -871,7 +871,7 @@  static gboolean gd_motion_event(GtkWidget *widget, GdkEventMotion *motion,
     int x, y;
     int mx, my;
     int fbh, fbw;
-    int ww, wh, ws;
+    int ww, wh;
 
     if (!vc->gfx.ds) {
         return TRUE;
@@ -883,7 +883,6 @@  static gboolean gd_motion_event(GtkWidget *widget, GdkEventMotion *motion,
     window = gtk_widget_get_window(vc->gfx.drawing_area);
     ww = gdk_window_get_width(window);
     wh = gdk_window_get_height(window);
-    ws = gdk_window_get_scale_factor(window);
 
     mx = my = 0;
     if (ww > fbw) {
@@ -893,8 +892,8 @@  static gboolean gd_motion_event(GtkWidget *widget, GdkEventMotion *motion,
         my = (wh - fbh) / 2;
     }
 
-    x = (motion->x - mx) / vc->gfx.scale_x * ws;
-    y = (motion->y - my) / vc->gfx.scale_y * ws;
+    x = (motion->x - mx) / vc->gfx.scale_x;
+    y = (motion->y - my) / vc->gfx.scale_y;
 
     if (qemu_input_is_absolute()) {
         if (x < 0 || y < 0 ||