[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL v2 09/36] ui: do not delay further remote resize
From: |
marcandre . lureau |
Subject: |
[PULL v2 09/36] ui: do not delay further remote resize |
Date: |
Tue, 21 Dec 2021 10:58:28 +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>
Acked-by: Gerd Hoffmann <kraxel@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 +-
ui/cocoa.m | 2 +-
7 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/include/ui/console.h b/include/ui/console.h
index 6d678924f6fd..65e6bbcab8ae 100644
--- a/include/ui/console.h
+++ b/include/ui/console.h
@@ -292,7 +292,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 29a3e3f0f51c..dcc21eb5b244 100644
--- a/ui/console.c
+++ b/ui/console.c
@@ -1538,7 +1538,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;
@@ -1558,7 +1558,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 428f02f2dfe1..c0d8a9f061ee 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 17c0ec30ebff..9ba3bc49e798 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 f59c69882d91..52d9f3260aab 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 9b603382e75e..1ed1c7efc688 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 */);
diff --git a/ui/cocoa.m b/ui/cocoa.m
index 7ca429fa8078..69745c483b45 100644
--- a/ui/cocoa.m
+++ b/ui/cocoa.m
@@ -552,7 +552,7 @@ QemuCocoaView *cocoaView;
info.width = frameSize.width;
info.height = frameSize.height;
- dpy_set_ui_info(dcl.con, &info);
+ dpy_set_ui_info(dcl.con, &info, TRUE);
}
- (void)viewDidMoveToWindow
--
2.34.1.8.g35151cf07204
- [PULL v2 00/36] ui: D-Bus display backend, marcandre . lureau, 2021/12/21
- [PULL v2 01/36] ui/vdagent: add CHECK_SPICE_PROTOCOL_VERSION, marcandre . lureau, 2021/12/21
- [PULL v2 02/36] ui/vdagent: replace #if 0 with protocol version check, marcandre . lureau, 2021/12/21
- [PULL v2 03/36] ui: generalize clipboard notifier, marcandre . lureau, 2021/12/21
- [PULL v2 04/36] ui/vdagent: add serial capability support, marcandre . lureau, 2021/12/21
- [PULL v2 05/36] ui/clipboard: add qemu_clipboard_check_serial(), marcandre . lureau, 2021/12/21
- [PULL v2 06/36] ui/clipboard: add a clipboard reset serial event, marcandre . lureau, 2021/12/21
- [PULL v2 07/36] hw/display: report an error if virgl initialization failed, marcandre . lureau, 2021/12/21
- [PULL v2 08/36] virtio-gpu: use VIRTIO_GPU_RESOURCE_FLAG_Y_0_TOP, marcandre . lureau, 2021/12/21
- [PULL v2 09/36] ui: do not delay further remote resize,
marcandre . lureau <=
- [PULL v2 10/36] ui: factor out qemu_console_set_display_gl_ctx(), marcandre . lureau, 2021/12/21
- [PULL v2 11/36] ui: associate GL context outside of display listener registration, marcandre . lureau, 2021/12/21
- [PULL v2 12/36] ui: make gl_block use a counter, marcandre . lureau, 2021/12/21
- [PULL v2 13/36] ui: add a gl-unblock warning timer, marcandre . lureau, 2021/12/21
- [PULL v2 14/36] ui: simplify gl unblock & flush, marcandre . lureau, 2021/12/21
- [PULL v2 15/36] ui: dispatch GL events to all listeners, marcandre . lureau, 2021/12/21
- [PULL v2 16/36] ui: split the GL context in a different object, marcandre . lureau, 2021/12/21
- [PULL v2 17/36] ui: move qemu_spice_fill_device_address to ui/util.c, marcandre . lureau, 2021/12/21
- [PULL v2 18/36] console: save current scanout details, marcandre . lureau, 2021/12/21
- [PULL v2 19/36] scripts: teach modinfo to skip non-C sources, marcandre . lureau, 2021/12/21