[gtk-vnc] src: fix handling of WMVi updates
- From: Daniel P. Berrange <dberrange src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk-vnc] src: fix handling of WMVi updates
- Date: Tue, 15 Dec 2020 17:25:15 +0000 (UTC)
commit 9d04d3d7960ace3fff4c9219e8928aada73ef61c
Author: Daniel P. Berrangé <dan berrange com>
Date: Fri Dec 11 17:06:11 2020 +0000
src: fix handling of WMVi updates
The WMVi update encodes a new pixel format and desktop size in one
request. Clients should not assume that a separate desktop size message
will arrive, although QEMU does send one. IOW, the desktop resize
signal must be emitted in response to a WMVi update too.
Signed-off-by: Daniel P. Berrangé <berrange redhat com>
src/vncconnection.c | 18 ++++++++++--------
1 file changed, 10 insertions(+), 8 deletions(-)
---
diff --git a/src/vncconnection.c b/src/vncconnection.c
index 00c5c8e..9c0f2d4 100644
--- a/src/vncconnection.c
+++ b/src/vncconnection.c
@@ -2958,21 +2958,18 @@ static void vnc_connection_server_cut_text(VncConnection *conn,
g_string_free(text, TRUE);
}
-static void vnc_connection_resize(VncConnection *conn, int width, int height)
+static void vnc_connection_resize(VncConnection *conn)
{
VncConnectionPrivate *priv = conn->priv;
struct signal_data sigdata;
- VNC_DEBUG("Desktop resize w=%d h=%d", width, height);
+ VNC_DEBUG("Desktop resize w=%d h=%d", priv->width, priv->height);
if (vnc_connection_has_error(conn))
return;
- priv->width = width;
- priv->height = height;
-
- sigdata.params.size.width = width;
- sigdata.params.size.height = height;
+ sigdata.params.size.width = priv->width;
+ sigdata.params.size.height = priv->height;
vnc_connection_emit_main_context(conn, VNC_DESKTOP_RESIZE, &sigdata);
}
@@ -3347,7 +3344,9 @@ static gboolean vnc_connection_framebuffer_update(VncConnection *conn, gint32 et
vnc_connection_update(conn, x, y, width, height);
break;
case VNC_CONNECTION_ENCODING_DESKTOP_RESIZE:
- vnc_connection_resize(conn, width, height);
+ priv->width = width;
+ priv->height = height;
+ vnc_connection_resize(conn);
break;
case VNC_CONNECTION_ENCODING_POINTER_CHANGE:
vnc_connection_pointer_type_change(conn, x);
@@ -3359,7 +3358,10 @@ static gboolean vnc_connection_framebuffer_update(VncConnection *conn, gint32 et
break;
case VNC_CONNECTION_ENCODING_WMVi:
vnc_connection_read_pixel_format(conn, &priv->fmt);
+ priv->width = width;
+ priv->height = height;
vnc_connection_pixel_format(conn);
+ vnc_connection_resize(conn);
break;
case VNC_CONNECTION_ENCODING_RICH_CURSOR:
vnc_connection_rich_cursor(conn, x, y, width, height);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]