[PATCH 0/2] ui/gtk: Add keep-aspect-ratio and scale option

Weifeng Liu posted 2 patches 5 months, 2 weeks ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20250601045245.36778-1-weifeng.liu.z@gmail.com
Maintainers: "Marc-André Lureau" <marcandre.lureau@redhat.com>, Eric Blake <eblake@redhat.com>, Markus Armbruster <armbru@redhat.com>
include/ui/gtk.h |  2 ++
qapi/ui.json     | 15 +++++++++----
ui/gtk.c         | 58 ++++++++++++++++++++++++++++++++----------------
3 files changed, 52 insertions(+), 23 deletions(-)
[PATCH 0/2] ui/gtk: Add keep-aspect-ratio and scale option
Posted by Weifeng Liu 5 months, 2 weeks ago
Add these options to give users more control over behaviors in gtk
display backend:

- keep-aspect-ratio: when set to true, if the aspect ratio of host
  window differs from that of guest frame-buffer, padding will be added
  to the host window to preserve the aspect ratio of guest frame-buffer.

- scale: allow user to set a preferred scale factor, which would be
  helpful for users running on a hi-dpi desktop to achieve pixel to
  pixel display.

Cc: BALATON Zoltan <balaton@eik.bme.hu>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Marc-André Lureau <marcandre.lureau@redhat.com>
Cc: Marc-André Lureau <marcandre.lureau@gmail.com>
Cc: "Kim, Dongwon" <dongwon.kim@intel.com>
Cc: Alex Bennée <alex.bennee@linaro.org>
Cc: Dmitry Osipenko <dmitry.osipenko@collabora.com>

Best regards,
Weifeng

Weifeng Liu (2):
  ui/gtk: Add keep-aspect-ratio option
  ui/gtk: Add scale option

 include/ui/gtk.h |  2 ++
 qapi/ui.json     | 15 +++++++++----
 ui/gtk.c         | 58 ++++++++++++++++++++++++++++++++----------------
 3 files changed, 52 insertions(+), 23 deletions(-)

-- 
2.49.0


Re: [PATCH 0/2] ui/gtk: Add keep-aspect-ratio and scale option
Posted by Marc-André Lureau 5 months, 2 weeks ago
On Sun, Jun 1, 2025 at 8:53 AM Weifeng Liu <weifeng.liu.z@gmail.com> wrote:

> Add these options to give users more control over behaviors in gtk
> display backend:
>
> - keep-aspect-ratio: when set to true, if the aspect ratio of host
>   window differs from that of guest frame-buffer, padding will be added
>   to the host window to preserve the aspect ratio of guest frame-buffer.
>
> - scale: allow user to set a preferred scale factor, which would be
>   helpful for users running on a hi-dpi desktop to achieve pixel to
>   pixel display.
>
> Cc: BALATON Zoltan <balaton@eik.bme.hu>
> Cc: Gerd Hoffmann <kraxel@redhat.com>
> Cc: Marc-André Lureau <marcandre.lureau@redhat.com>
> Cc: Marc-André Lureau <marcandre.lureau@gmail.com>
> Cc: "Kim, Dongwon" <dongwon.kim@intel.com>
> Cc: Alex Bennée <alex.bennee@linaro.org>
> Cc: Dmitry Osipenko <dmitry.osipenko@collabora.com>
>

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Tested-by: Marc-André Lureau <marcandre.lureau@redhat.com>


> Best regards,
> Weifeng
>
> Weifeng Liu (2):
>   ui/gtk: Add keep-aspect-ratio option
>   ui/gtk: Add scale option
>
>  include/ui/gtk.h |  2 ++
>  qapi/ui.json     | 15 +++++++++----
>  ui/gtk.c         | 58 ++++++++++++++++++++++++++++++++----------------
>  3 files changed, 52 insertions(+), 23 deletions(-)
>
> --
> 2.49.0
>
>