Hi Michael,

On Thu, 2025-05-29 at 10:23 +0300, Michael Tokarev wrote:
> On 11.05.2025 10:33, Weifeng Liu wrote:
> > Hi all,
> > 
> > Now we have quite a lot of display backends for different use
> > cases.
> > Even in the context of gtk, we have various implementations (e.g.,
> > gl=on
> > vs gl=off, X11 vs Wayland). However, behaviors to users are not
> > aligned
> > across the backends, especially in the part of scale handling. This
> > patch set attempts to improve scale handling.
> > 
> > We have to deal with various coordinates due to the existence of
> > scaling
> > in different level. Firstly, in desktop level, we could have a
> > global
> > window scale factor. Secondly, users might set a zooming factor to
> > adjust the size of guest content in scan-out level. Consequently,
> > 1) the
> > buffer from guest, 2) the host window and 3) OpenGl drawing area
> > inside
> > the host window are in distinct coordinates. It's important to
> > define
> > these coordinates and scales unambiguously and use a consistent
> > naming
> > convention for variables representing different concepts. The first
> > patch in this set tries to achieve this goal by adding a document
> > in
> > gtk.c, and the next patch (PATCH 2) attempts to align the code with
> > the
> > document.
> > 
> > PATCH 3 - 5 fix bugs in mouse position calculation due to not
> > handling
> > scale properly, for both gtk and sdl.
> > 
> > PATCH 6 align scale update logic in gtk-egl with other
> > implementations.
> > 
> > PATCH 7 fix an issue that gtk window might keep enlarging/shrinking
> > because
> > ui info propagating to guest not considering scale.
> > 
> > PATCH 8 and 9 align fixed-scale mode behavior in gtk-gl-area and
> > gtk-egl with
> > other implementations by adding appropriate padding to the window
> > to preserve
> > the scale.
> ...
> > Weifeng Liu (9):
> >    ui/gtk: Document scale and coordinate handling
> >    ui/gtk: Use consistent naming for variables in different
> > coordinates
> >    gtk/ui: Introduce helper gd_update_scale
> >    ui/gtk: Update scales in fixed-scale mode when rendering GL area
> >    ui/sdl: Consider scaling in mouse event handling
> >    ui/gtk: Don't update scale in fixed scale mode in gtk-egl.c
> >    ui/gtk: Consider scaling when propagating ui info
> >    ui/gtk-gl-area: Render guest content with padding in fixed-scale
> > mode
> >    ui/gtk-egl: Render guest content with padding in fixed-scale
> > mode
> 
> Is there anything here which should be picked up for qemu-stable
> (current active branches: 7.2 and 10.0)?
> 

I think the first five patches are good candidates for backporting to
the stable branches, as they only address bugs without altering
existing behavior. I was able to apply them cleanly to stable-10.0, but
porting them to 7.2 will require some additional effort. I'll send out
a new patch set once the backporting work is complete.

Best regards,
Weifeng

> Thanks,
> 
> /mjt

Reply via email to