From f353411460fb561198d7cc1fb589584fbceb9f34 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Fri, 23 Sep 2016 15:43:35 -0700 Subject: [PATCH] GUACAMOLE-187: Do not perform surface resize unless the new size is actually different. --- src/common/surface.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/common/surface.c b/src/common/surface.c index a4fd4c62..c5cee006 100644 --- a/src/common/surface.c +++ b/src/common/surface.c @@ -1104,6 +1104,10 @@ void guac_common_surface_resize(guac_common_surface* surface, int w, int h) { pthread_mutex_lock(&surface->_lock); + /* Ignore if resize will have no effect */ + if (w == surface->width && h == surface->height) + goto complete; + guac_socket* socket = surface->socket; const guac_layer* layer = surface->layer; @@ -1153,6 +1157,7 @@ void guac_common_surface_resize(guac_common_surface* surface, int w, int h) { if (surface->realized) guac_protocol_send_size(socket, layer, w, h); +complete: pthread_mutex_unlock(&surface->_lock); }