On Tue, 13 May 2025, Weifeng Liu wrote:
Hi,

On Tue, 2025-05-13 at 00:37 +0000, Kim, Dongwon wrote:
Hi,

> Subject: [PATCH 8/9] ui/gtk-gl-area: Render guest content with
> padding in
> fixed-scale mode
> > In fixed-scale mode (zoom-to-fit=false), we expect that scale
> should not
> change, meaning that if window size is larger than guest surface,
> padding is

# @zoom-to-fit: Zoom guest display to fit into the host window.  When
#     turned off the host window will be resized instead.  In case
the
#     display device can notify the guest on window resizes
#     (virtio-gpu) this will default to "on", assuming the guest will
#     resize the display to match the window size then.  Otherwise it
#     defaults to "off".  (Since 3.1)

Current definition says the host window should be resized to fit the
size of the guest surface instead. Wouldn't padding accommodate this?


Yeah, window will be resized to fit the size of guest surface in fixed-
scale mode. However, users are still allowed to resize the window to a
larger size and this is case where padding is required, otherwise the
fixed-scale assumption is broken. In fact, gl=off mode employs padding
to preserve scale already but gl=on mode doesn't follow this behavior,
which, IMO, is a defect that this patch is trying to correct.

I think current set of switches is not enough to describe all possible configs and this leads to inconsistency between display backends. Each display backend has different idea on how zoom-to-fit should work now. Maybe we need a new keep-aspect=off or similar option to make it explicit then these can be set independently to decide if a full-screen zoom-to-fit window should be stretched or padded. Currently it behaves differently depending on display backend or even options of one display backend as you say above. Fixing just one place won't solve the problem with other backends so maybe separating this option into a new one would end this inconsistency. I got requests from people for both padded or stretched behaviour so it seems some prefer one or the other and just zoom-to-fit can't set both.

Regards,
BALATON Zoltan

Reply via email to