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>
This commit is contained in:
Alexander Orzechowski 2021-11-21 01:55:03 -05:00 committed by Gerd Hoffmann
parent c5fbdd60cf
commit 4323118cad

View File

@ -41,15 +41,16 @@ void gd_gl_area_draw(VirtualConsole *vc)
#ifdef CONFIG_GBM #ifdef CONFIG_GBM
QemuDmaBuf *dmabuf = vc->gfx.guest_fb.dmabuf; QemuDmaBuf *dmabuf = vc->gfx.guest_fb.dmabuf;
#endif #endif
int ww, wh, y1, y2; int ww, wh, ws, y1, y2;
if (!vc->gfx.gls) { if (!vc->gfx.gls) {
return; return;
} }
gtk_gl_area_make_current(GTK_GL_AREA(vc->gfx.drawing_area)); gtk_gl_area_make_current(GTK_GL_AREA(vc->gfx.drawing_area));
ww = gtk_widget_get_allocated_width(vc->gfx.drawing_area); ws = gdk_window_get_scale_factor(gtk_widget_get_window(vc->gfx.drawing_area));
wh = gtk_widget_get_allocated_height(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.scanout_mode) {
if (!vc->gfx.guest_fb.framebuffer) { if (!vc->gfx.guest_fb.framebuffer) {