[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 10/37] ui: do not delay further remote resize
From: |
marcandre . lureau |
Subject: |
[PATCH v2 10/37] ui: do not delay further remote resize |
Date: |
Sun, 10 Oct 2021 01:08:11 +0400 |
From: Marc-André Lureau <marcandre.lureau@redhat.com>
A remote client, such as Spice, will already avoid flooding the stream
by delaying the resize requests.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
include/ui/console.h | 2 +-
ui/console.c | 5 +++--
ui/gtk.c | 2 +-
ui/sdl2.c | 2 +-
ui/spice-display.c | 2 +-
ui/vnc.c | 2 +-
6 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/include/ui/console.h b/include/ui/console.h
index 244664d727..7b2f624e93 100644
--- a/include/ui/console.h
+++ b/include/ui/console.h
@@ -287,7 +287,7 @@ void unregister_displaychangelistener(DisplayChangeListener
*dcl);
bool dpy_ui_info_supported(QemuConsole *con);
const QemuUIInfo *dpy_get_ui_info(const QemuConsole *con);
-int dpy_set_ui_info(QemuConsole *con, QemuUIInfo *info);
+int dpy_set_ui_info(QemuConsole *con, QemuUIInfo *info, bool delay);
void dpy_gfx_update(QemuConsole *con, int x, int y, int w, int h);
void dpy_gfx_update_full(QemuConsole *con);
diff --git a/ui/console.c b/ui/console.c
index eabbbc951c..7eea1fc641 100644
--- a/ui/console.c
+++ b/ui/console.c
@@ -1596,7 +1596,7 @@ const QemuUIInfo *dpy_get_ui_info(const QemuConsole *con)
return &con->ui_info;
}
-int dpy_set_ui_info(QemuConsole *con, QemuUIInfo *info)
+int dpy_set_ui_info(QemuConsole *con, QemuUIInfo *info, bool delay)
{
if (con == NULL) {
con = active_console;
@@ -1616,7 +1616,8 @@ int dpy_set_ui_info(QemuConsole *con, QemuUIInfo *info)
* go notify the guest.
*/
con->ui_info = *info;
- timer_mod(con->ui_timer, qemu_clock_get_ms(QEMU_CLOCK_REALTIME) + 1000);
+ timer_mod(con->ui_timer,
+ qemu_clock_get_ms(QEMU_CLOCK_REALTIME) + (delay ? 1000 : 0));
return 0;
}
diff --git a/ui/gtk.c b/ui/gtk.c
index b0564d80c1..163b6bcb6a 100644
--- a/ui/gtk.c
+++ b/ui/gtk.c
@@ -698,7 +698,7 @@ static void gd_set_ui_info(VirtualConsole *vc, gint width,
gint height)
memset(&info, 0, sizeof(info));
info.width = width;
info.height = height;
- dpy_set_ui_info(vc->gfx.dcl.con, &info);
+ dpy_set_ui_info(vc->gfx.dcl.con, &info, true);
}
#if defined(CONFIG_OPENGL)
diff --git a/ui/sdl2.c b/ui/sdl2.c
index 17c0ec30eb..9ba3bc49e7 100644
--- a/ui/sdl2.c
+++ b/ui/sdl2.c
@@ -561,7 +561,7 @@ static void handle_windowevent(SDL_Event *ev)
memset(&info, 0, sizeof(info));
info.width = ev->window.data1;
info.height = ev->window.data2;
- dpy_set_ui_info(scon->dcl.con, &info);
+ dpy_set_ui_info(scon->dcl.con, &info, true);
}
sdl2_redraw(scon);
break;
diff --git a/ui/spice-display.c b/ui/spice-display.c
index f59c69882d..52d9f3260a 100644
--- a/ui/spice-display.c
+++ b/ui/spice-display.c
@@ -692,7 +692,7 @@ static int interface_client_monitors_config(QXLInstance
*sin,
}
trace_qemu_spice_ui_info(ssd->qxl.id, info.width, info.height);
- dpy_set_ui_info(ssd->dcl.con, &info);
+ dpy_set_ui_info(ssd->dcl.con, &info, false);
return 1;
}
diff --git a/ui/vnc.c b/ui/vnc.c
index 9b603382e7..1ed1c7efc6 100644
--- a/ui/vnc.c
+++ b/ui/vnc.c
@@ -2596,7 +2596,7 @@ static int protocol_client_msg(VncState *vs, uint8_t
*data, size_t len)
memset(&info, 0, sizeof(info));
info.width = w;
info.height = h;
- dpy_set_ui_info(vs->vd->dcl.con, &info);
+ dpy_set_ui_info(vs->vd->dcl.con, &info, false);
vnc_desktop_resize_ext(vs, 4 /* Request forwarded */);
} else {
vnc_desktop_resize_ext(vs, 3 /* Invalid screen layout */);
--
2.33.0.721.g106298f7f9
- [PATCH v2 00/37] Add D-Bus display backend, marcandre . lureau, 2021/10/09
- [PATCH v2 01/37] build-sys: move Spice configure handling to meson, marcandre . lureau, 2021/10/09
- [PATCH v2 02/37] ui/vdagent: add CHECK_SPICE_PROTOCOL_VERSION, marcandre . lureau, 2021/10/09
- [PATCH v2 03/37] ui/vdagent: replace #if 0 with protocol version check, marcandre . lureau, 2021/10/09
- [PATCH v2 04/37] ui: generalize clipboard notifier, marcandre . lureau, 2021/10/09
- [PATCH v2 05/37] ui/vdagent: add serial capability support, marcandre . lureau, 2021/10/09
- [PATCH v2 06/37] ui/clipboard: add qemu_clipboard_check_serial(), marcandre . lureau, 2021/10/09
- [PATCH v2 07/37] ui/clipboard: add a clipboard reset serial event, marcandre . lureau, 2021/10/09
- [PATCH v2 08/37] hw/display: report an error if virgl initialization failed, marcandre . lureau, 2021/10/09
- [PATCH v2 09/37] virtio-gpu: use VIRTIO_GPU_RESOURCE_FLAG_Y_0_TOP, marcandre . lureau, 2021/10/09
- [PATCH v2 10/37] ui: do not delay further remote resize,
marcandre . lureau <=
- [PATCH v2 11/37] ui: factor out qemu_console_set_display_gl_ctx(), marcandre . lureau, 2021/10/09
- [PATCH v2 12/37] ui: associate GL context outside of display listener registration, marcandre . lureau, 2021/10/09
- [PATCH v2 13/37] ui: make gl_block use a counter, marcandre . lureau, 2021/10/09
- [PATCH v2 14/37] ui: add a gl-unblock warning timer, marcandre . lureau, 2021/10/09
- [PATCH v2 15/37] ui: simplify gl unblock & flush, marcandre . lureau, 2021/10/09
- [PATCH v2 16/37] ui: dispatch GL events to all listeners, marcandre . lureau, 2021/10/09
- [PATCH v2 17/37] ui: split the GL context in a different object, marcandre . lureau, 2021/10/09
- [PATCH v2 18/37] ui: move qemu_spice_fill_device_address to ui/util.c, marcandre . lureau, 2021/10/09
- [PATCH v2 19/37] console: save current scanout details, marcandre . lureau, 2021/10/09
- [PATCH v2 20/37] scripts: teach modinfo to skip non-C sources, marcandre . lureau, 2021/10/09