diff options
author | Alexander Orzechowski <orzechowski.alexander@gmail.com> | 2021-11-21 01:55:03 -0500 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2021-11-22 11:13:12 +0100 |
commit | 4323118cadc5a316f73b5b0a60b5789ed9201369 (patch) | |
tree | 10ffefafd3098007265a29cd1cf158a8a7f67a22 /ui | |
parent | c5fbdd60cf1fb52f01bdfe342b6fa65d5343e1b1 (diff) | |
download | qemu-4323118cadc5a316f73b5b0a60b5789ed9201369.zip qemu-4323118cadc5a316f73b5b0a60b5789ed9201369.tar.gz qemu-4323118cadc5a316f73b5b0a60b5789ed9201369.tar.bz2 |
ui: fix incorrect scaling on highdpi with gtk/opengl
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>
Diffstat (limited to 'ui')
-rw-r--r-- | ui/gtk-gl-area.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/ui/gtk-gl-area.c b/ui/gtk-gl-area.c index 461da77..01e4e74 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) { |