[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 08/13] ui/gtk: fix UI info precondition
From: |
marcandre . lureau |
Subject: |
[PULL 08/13] ui/gtk: fix UI info precondition |
Date: |
Tue, 3 Oct 2023 16:35:37 +0400 |
From: Marc-André Lureau <marcandre.lureau@redhat.com>
dpy_get_ui_info() shouldn't be called if the underlying GPU doesn't
support it.
Before the assert() was added and the regression introduced, GTK code
used to get "zero" UI info, for ex with a simple VGA device. The assert
was added to prevent from calling when there are no console too. The
other display backend that calls dpy_get_ui_info() correctly checks that
pre-condition.
Calling dpy_set_ui_info() is "safe" in this case, it will simply return
an error that can be generally ignored.
Fixes: commit a92e7bb4c ("ui: add precondition for dpy_get_ui_info()")
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
ui/gtk.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/ui/gtk.c b/ui/gtk.c
index cd3b8953cd..935de1209b 100644
--- a/ui/gtk.c
+++ b/ui/gtk.c
@@ -726,6 +726,10 @@ static void gd_set_ui_refresh_rate(VirtualConsole *vc, int
refresh_rate)
{
QemuUIInfo info;
+ if (!dpy_ui_info_supported(vc->gfx.dcl.con)) {
+ return;
+ }
+
info = *dpy_get_ui_info(vc->gfx.dcl.con);
info.refresh_rate = refresh_rate;
dpy_set_ui_info(vc->gfx.dcl.con, &info, true);
@@ -735,6 +739,10 @@ static void gd_set_ui_size(VirtualConsole *vc, gint width,
gint height)
{
QemuUIInfo info;
+ if (!dpy_ui_info_supported(vc->gfx.dcl.con)) {
+ return;
+ }
+
info = *dpy_get_ui_info(vc->gfx.dcl.con);
info.width = width;
info.height = height;
--
2.41.0
- [PULL 00/13] Misc patches, marcandre . lureau, 2023/10/03
- [PULL 01/13] input: Allow to choose console with qemu_input_is_absolute, marcandre . lureau, 2023/10/03
- [PULL 02/13] ui/console: make qemu_console_is_multihead() static, marcandre . lureau, 2023/10/03
- [PULL 04/13] ui/console: eliminate QOM properties from qemu_console_is_multihead(), marcandre . lureau, 2023/10/03
- [PULL 03/13] ui/console: only walk QemuGraphicConsoles in qemu_console_is_multihead(), marcandre . lureau, 2023/10/03
- [PULL 05/13] ui/console: sanitize search in qemu_graphic_console_is_multihead(), marcandre . lureau, 2023/10/03
- [PULL 07/13] win32: avoid discarding the exception handler, marcandre . lureau, 2023/10/03
- [PULL 06/13] ui: add XBGR8888 and ABGR8888 in drm_format_pixman_map, marcandre . lureau, 2023/10/03
- [PULL 08/13] ui/gtk: fix UI info precondition,
marcandre . lureau <=
- [PULL 09/13] analyze-migration: ignore RAM_SAVE_FLAG_MULTIFD_FLUSH, marcandre . lureau, 2023/10/03
- [PULL 10/13] hw/core: remove needless includes, marcandre . lureau, 2023/10/03
- [PULL 13/13] chardev/char-pty: Avoid losing bytes when the other side just (re-)connected, marcandre . lureau, 2023/10/03
- [PULL 11/13] hw/pc: remove needless includes, marcandre . lureau, 2023/10/03
- [PULL 12/13] hw/display/ramfb: plug slight guest-triggerable leak on mode setting, marcandre . lureau, 2023/10/03
- Re: [PULL 00/13] Misc patches, Stefan Hajnoczi, 2023/10/05