[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 6/9] ui/gtk: Don't update scale in fixed scale mode in gtk-egl.c
From: |
Weifeng Liu |
Subject: |
[PATCH 6/9] ui/gtk: Don't update scale in fixed scale mode in gtk-egl.c |
Date: |
Sun, 11 May 2025 15:33:16 +0800 |
Scale shouldn't be changed until user explicitly requests it in fixed
scale mode (full-screen=false and free-scale=false). Use function
gd_update_scale to complete scale updating instead.
Signed-off-by: Weifeng Liu <weifeng.liu.z@gmail.com>
---
ui/gtk-egl.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/ui/gtk-egl.c b/ui/gtk-egl.c
index 947c99334b..f8e4f4bc70 100644
--- a/ui/gtk-egl.c
+++ b/ui/gtk-egl.c
@@ -95,8 +95,9 @@ void gd_egl_draw(VirtualConsole *vc)
#endif
gd_egl_scanout_flush(&vc->gfx.dcl, 0, 0, vc->gfx.w, vc->gfx.h);
- vc->gfx.scale_x = (double)ww / surface_width(vc->gfx.ds);
- vc->gfx.scale_y = (double)wh / surface_height(vc->gfx.ds);
+ gd_update_scale(vc, ww, wh,
+ surface_width(vc->gfx.ds),
+ surface_height(vc->gfx.ds));
glFlush();
#ifdef CONFIG_GBM
@@ -122,8 +123,9 @@ void gd_egl_draw(VirtualConsole *vc)
eglSwapBuffers(qemu_egl_display, vc->gfx.esurface);
- vc->gfx.scale_x = (double)ww / surface_width(vc->gfx.ds);
- vc->gfx.scale_y = (double)wh / surface_height(vc->gfx.ds);
+ gd_update_scale(vc, ww, wh,
+ surface_width(vc->gfx.ds),
+ surface_height(vc->gfx.ds));
glFlush();
}
--
2.49.0
- Re: [PATCH 1/9] ui/gtk: Document scale and coordinate handling, (continued)
- [PATCH 4/9] ui/gtk: Update scales in fixed-scale mode when rendering GL area, Weifeng Liu, 2025/05/11
- [PATCH 2/9] ui/gtk: Use consistent naming for variables in different coordinates, Weifeng Liu, 2025/05/11
- [PATCH 5/9] ui/sdl: Consider scaling in mouse event handling, Weifeng Liu, 2025/05/11
- [PATCH 7/9] ui/gtk: Consider scaling when propagating ui info, Weifeng Liu, 2025/05/11
- [PATCH 6/9] ui/gtk: Don't update scale in fixed scale mode in gtk-egl.c,
Weifeng Liu <=
- [PATCH 8/9] ui/gtk-gl-area: Render guest content with padding in fixed-scale mode, Weifeng Liu, 2025/05/11
[PATCH 9/9] ui/gtk-egl: Render guest content with padding in fixed-scale mode, Weifeng Liu, 2025/05/11
Re: [PATCH 0/9] ui: Improve scale handling, Gerd Hoffmann, 2025/05/12