aboutsummaryrefslogtreecommitdiff
path: root/ui
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2021-04-13 20:39:11 +0400
committerMarc-André Lureau <marcandre.lureau@redhat.com>2021-12-21 10:50:21 +0400
commitca19ef52999251443b511b53e7b0498dd247261e (patch)
tree910c07bed1bebacff9f6a873b5b2bc781d28b04e /ui
parent46e4609e339f424a0e19c1fb657ccad6a43f7364 (diff)
ui: do not delay further remote resize
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>
Diffstat (limited to 'ui')
-rw-r--r--ui/cocoa.m2
-rw-r--r--ui/console.c5
-rw-r--r--ui/gtk.c2
-rw-r--r--ui/sdl2.c2
-rw-r--r--ui/spice-display.c2
-rw-r--r--ui/vnc.c2
6 files changed, 8 insertions, 7 deletions
diff --git a/ui/cocoa.m b/ui/cocoa.m
index 7ca429fa80..69745c483b 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
diff --git a/ui/console.c b/ui/console.c
index 29a3e3f0f5..dcc21eb5b2 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 428f02f2df..c0d8a9f061 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 */);