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 --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 ||
--
2.20.1