diff --git a/src/protocols/vnc/settings.c b/src/protocols/vnc/settings.c index 09ee8a7a4..c7dda5890 100644 --- a/src/protocols/vnc/settings.c +++ b/src/protocols/vnc/settings.c @@ -38,6 +38,7 @@ const char* GUAC_VNC_CLIENT_ARGS[] = { "hostname", "port", "read-only", + "disable-display-resize", "encodings", GUAC_VNC_ARGV_USERNAME, GUAC_VNC_ARGV_PASSWORD, @@ -119,6 +120,13 @@ enum VNC_ARGS_IDX { */ IDX_READ_ONLY, + /** + * "true" if the VNC client should disable attempts to resize the remote + * display to the client's size, "false" or blank if those resize messages + * should be sent. + */ + IDX_DISABLE_DISPLAY_RESIZE, + /** * Space-separated list of encodings to use within the VNC session. If not * specified, this will be: @@ -469,6 +477,11 @@ guac_vnc_settings* guac_vnc_parse_args(guac_user* user, guac_user_parse_args_boolean(user, GUAC_VNC_CLIENT_ARGS, argv, IDX_DISABLE_SERVER_INPUT, false); + /* Disable display resize */ + settings->disable_display_resize = + guac_user_parse_args_boolean(user, GUAC_VNC_CLIENT_ARGS, argv, + IDX_DISABLE_DISPLAY_RESIZE, false); + /* Parse color depth */ settings->color_depth = guac_user_parse_args_int(user, GUAC_VNC_CLIENT_ARGS, argv, diff --git a/src/protocols/vnc/settings.h b/src/protocols/vnc/settings.h index 3b885816d..e5c3b7798 100644 --- a/src/protocols/vnc/settings.h +++ b/src/protocols/vnc/settings.h @@ -54,6 +54,12 @@ typedef struct guac_vnc_settings { */ char* password; + /** + * Disable the VNC client messages to request that the remote (server) + * display resize to match the client resolution. + */ + bool disable_display_resize; + /** * Space-separated list of encodings to use within the VNC session. */ diff --git a/src/protocols/vnc/user.c b/src/protocols/vnc/user.c index 8134707fc..4cb351769 100644 --- a/src/protocols/vnc/user.c +++ b/src/protocols/vnc/user.c @@ -92,7 +92,7 @@ int guac_vnc_user_join_handler(guac_user* user, int argc, char** argv) { #endif /* If user is owner, set size handler. */ - if (user->owner) + if (user->owner && !settings->disable_display_resize) user->size_handler = guac_vnc_user_size_handler; } diff --git a/src/protocols/vnc/vnc.c b/src/protocols/vnc/vnc.c index f2df4f4c0..b1bd86087 100644 --- a/src/protocols/vnc/vnc.c +++ b/src/protocols/vnc/vnc.c @@ -510,7 +510,8 @@ void* guac_vnc_client_thread(void* data) { } /* Update the display with the owner's screen size. */ - guac_client_for_owner(client, guac_vnc_display_set_owner_size, rfb_client); + if (!settings->disable_display_resize) + guac_client_for_owner(client, guac_vnc_display_set_owner_size, rfb_client); guac_socket_flush(client->socket);