From: Gerd Hoffmann <kraxel@redhat.com>
To: qemu-devel@nongnu.org
Cc: Eduardo Habkost <ehabkost@redhat.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
Richard Henderson <richard.henderson@linaro.org>,
Gerd Hoffmann <kraxel@redhat.com>,
Alexander Orzechowski <orzechowski.alexander@gmail.com>,
Paolo Bonzini <pbonzini@redhat.com>
Subject: [PULL 1/8] ui: fix incorrect scaling on highdpi with gtk/opengl
Date: Mon, 22 Nov 2021 13:40:08 +0100 [thread overview]
Message-ID: <20211122124015.909318-2-kraxel@redhat.com> (raw)
In-Reply-To: <20211122124015.909318-1-kraxel@redhat.com>
From: Alexander Orzechowski <orzechowski.alexander@gmail.com>
Signed-off-by: Alexander Orzechowski <orzechowski.alexander@gmail.com>
Message-Id: <20211121065504.29101-2-orzechowski.alexander@gmail.com>
[ kraxel: codestyle fix ]
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
ui/gtk-gl-area.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/ui/gtk-gl-area.c b/ui/gtk-gl-area.c
index 461da7712f4f..01e4e74ee361 100644
--- a/ui/gtk-gl-area.c
+++ b/ui/gtk-gl-area.c
@@ -41,15 +41,16 @@ void gd_gl_area_draw(VirtualConsole *vc)
#ifdef CONFIG_GBM
QemuDmaBuf *dmabuf = vc->gfx.guest_fb.dmabuf;
#endif
- int ww, wh, y1, y2;
+ int ww, wh, ws, y1, y2;
if (!vc->gfx.gls) {
return;
}
gtk_gl_area_make_current(GTK_GL_AREA(vc->gfx.drawing_area));
- 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));
+ ww = gtk_widget_get_allocated_width(vc->gfx.drawing_area) * ws;
+ wh = gtk_widget_get_allocated_height(vc->gfx.drawing_area) * ws;
if (vc->gfx.scanout_mode) {
if (!vc->gfx.guest_fb.framebuffer) {
--
2.33.1
next prev parent reply other threads:[~2021-11-22 12:47 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-22 12:40 [PULL 0/8] Fixes 20211122 patches Gerd Hoffmann
2021-11-22 12:40 ` Gerd Hoffmann [this message]
2021-11-22 12:40 ` [PULL 2/8] ui: fix incorrect pointer position on highdpi with gtk Gerd Hoffmann
2021-11-22 12:40 ` [PULL 3/8] ui/gtk: graphic_hw_gl_flushed after closing dmabuf->fence_fd Gerd Hoffmann
2021-11-22 12:40 ` [PULL 4/8] ui/vnc-clipboard: fix adding notifier twice Gerd Hoffmann
2021-11-22 12:40 ` [PULL 5/8] migration: fix dump-vmstate with modules Gerd Hoffmann
2021-11-22 12:40 ` [PULL 6/8] hw/i386/microvm: Reduce annoying debug message in dt_setup_microvm() Gerd Hoffmann
2021-11-22 12:40 ` [PULL 7/8] microvm: add missing g_free() call Gerd Hoffmann
2021-11-22 12:40 ` [PULL 8/8] microvm: check g_file_set_contents() return value Gerd Hoffmann
2021-11-22 15:35 ` [PULL 0/8] Fixes 20211122 patches Richard Henderson
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=20211122124015.909318-2-kraxel@redhat.com \
--to=kraxel@redhat.com \
--cc=ehabkost@redhat.com \
--cc=mst@redhat.com \
--cc=orzechowski.alexander@gmail.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).