From ee1731cf9b0335b0eb9043b5057ddeee530bef02 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Fri, 27 Dec 2013 00:07:17 -0800 Subject: [PATCH] Add resolution member to client info struct. Interpret new third parameter for screen size. --- src/guacd/daemon.c | 8 ++++++++ src/libguac/guacamole/client.h | 9 +++++++++ 2 files changed, 17 insertions(+) diff --git a/src/guacd/daemon.c b/src/guacd/daemon.c index 2939aaf2..38e892b9 100644 --- a/src/guacd/daemon.c +++ b/src/guacd/daemon.c @@ -202,6 +202,14 @@ void guacd_handle_connection(guac_socket* socket) { client->info.optimal_width = atoi(size->argv[0]); client->info.optimal_height = atoi(size->argv[1]); + /* If DPI given, set the client resolution */ + if (size->argc >= 3) + client->info.optimal_resolution = atoi(size->argv[2]); + + /* Otherwise, use a safe default for rough backwards compatibility */ + else + client->info.optimal_resolution = 96; + /* Store audio mimetypes */ client->info.audio_mimetypes = malloc(sizeof(char*) * (audio->argc+1)); memcpy(client->info.audio_mimetypes, audio->argv, diff --git a/src/libguac/guacamole/client.h b/src/libguac/guacamole/client.h index 3bd36e31..388a3d2d 100644 --- a/src/libguac/guacamole/client.h +++ b/src/libguac/guacamole/client.h @@ -238,6 +238,15 @@ typedef struct guac_client_info { */ const char** video_mimetypes; + /** + * The DPI of the physical remote display if configured for the optimal + * width/height combination described here. This need not be honored by + * a client plugin implementation, but if the underlying protocol of the + * client plugin supports dynamic sizing of the screen, honoring the + * stated resolution of the display size request is recommended. + */ + int optimal_resolution; + } guac_client_info; /**