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>
This commit is contained in:
Marc-André Lureau 2021-04-13 20:39:11 +04:00
parent 46e4609e33
commit ca19ef5299
7 changed files with 9 additions and 8 deletions

View File

@ -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);

View File

@ -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

View File

@ -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;
}

View File

@ -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)

View File

@ -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;

View File

@ -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;
}

View File

@ -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 */);