All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexander Orzechowski <orzechowski.alexander@gmail.com>
To: QEMU <qemu-devel@nongnu.org>
Cc: qemu trivial <qemu-trivial@nongnu.org>,
	Mark-Andre Lureau <marcandre.lureau@gmail.com>,
	Gerd Hoffmann <kraxel@redhat.com>,
	Alexander Orzechowski <orzechowski.alexander@gmail.com>
Subject: [PATCH v2 2/3] ui: Revert: "fix incorrect pointer position on highdpi with gtk"
Date: Tue, 21 Dec 2021 19:10:50 -0500	[thread overview]
Message-ID: <20211222001051.2295513-3-orzechowski.alexander@gmail.com> (raw)
In-Reply-To: <20211222001051.2295513-1-orzechowski.alexander@gmail.com>

This reverts commit f14aab420c58b57e07189d6d9e6d3fbfab4761a6.

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>
---
 ui/gtk.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/ui/gtk.c b/ui/gtk.c
index 824334ff3d..b7f296fac7 100644
--- a/ui/gtk.c
+++ b/ui/gtk.c
@@ -836,7 +836,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;
@@ -847,8 +847,6 @@ static gboolean gd_motion_event(GtkWidget *widget, GdkEventMotion *motion,
 
     ww = gtk_widget_get_allocated_width(vc->gfx.drawing_area);
     wh = gtk_widget_get_allocated_height(vc->gfx.drawing_area);
-    ws = gdk_window_get_scale_factor(
-            gtk_widget_get_window(vc->gfx.drawing_area));
 
     mx = my = 0;
     if (ww > fbw) {
@@ -858,8 +856,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.34.1



  parent reply	other threads:[~2021-12-22  0:15 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-22  0:10 [PATCH v2 0/3] UI fixups Alexander Orzechowski
2021-12-22  0:10 ` [PATCH v2 1/3] ui: Use allocated size instead of window size Alexander Orzechowski
2021-12-22  0:10 ` Alexander Orzechowski [this message]
2021-12-22  0:10 ` [PATCH v2 3/3] ui: Fix gtk/gl when the scaled virtual console does not fit the window Alexander Orzechowski
2021-12-22 11:52   ` Marc-André Lureau

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211222001051.2295513-3-orzechowski.alexander@gmail.com \
    --to=orzechowski.alexander@gmail.com \
    --cc=kraxel@redhat.com \
    --cc=marcandre.lureau@gmail.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.