GUACAMOLE-448: Add support for configuring bitmap caching.

This commit is contained in:
Nick Couchman 2018-01-02 18:26:29 -05:00
parent 5295886f68
commit 66ffda24f0
2 changed files with 40 additions and 2 deletions

View File

@ -72,6 +72,8 @@ const char* GUAC_RDP_CLIENT_ARGS[] = {
"enable-full-window-drag", "enable-full-window-drag",
"enable-desktop-composition", "enable-desktop-composition",
"enable-menu-animations", "enable-menu-animations",
"disable-bitmap-caching",
"disable-offscreen-caching",
"preconnection-id", "preconnection-id",
"preconnection-blob", "preconnection-blob",
@ -305,6 +307,18 @@ enum RDP_ARGS_IDX {
*/ */
IDX_ENABLE_MENU_ANIMATIONS, IDX_ENABLE_MENU_ANIMATIONS,
/**
* "true" if bitmap caching should be disabled, "false" if bitmap caching
* should remain enabled.
*/
IDX_DISABLE_BITMAP_CACHING,
/**
* "true" if the offscreen caching should be disabled, false if offscren
* caching should remain enabled.
*/
IDX_DISABLE_OFFSCREEN_CACHING,
/** /**
* The preconnection ID to send within the preconnection PDU when * The preconnection ID to send within the preconnection PDU when
* initiating an RDP connection, if any. * initiating an RDP connection, if any.
@ -672,6 +686,14 @@ guac_rdp_settings* guac_rdp_parse_args(guac_user* user,
guac_user_parse_args_boolean(user, GUAC_RDP_CLIENT_ARGS, argv, guac_user_parse_args_boolean(user, GUAC_RDP_CLIENT_ARGS, argv,
IDX_ENABLE_MENU_ANIMATIONS, 0); IDX_ENABLE_MENU_ANIMATIONS, 0);
settings->disable_bitmap_caching =
guac_user_parse_args_boolean(user, GUAC_RDP_CLIENT_ARGS, argv,
IDX_DISABLE_BITMAP_CACHING, 0);
settings->disable_offscreen_caching =
guac_user_parse_args_boolean(user, GUAC_RDP_CLIENT_ARGS, argv,
IDX_DISABLE_OFFSCREEN_CACHING, 0);
/* Session color depth */ /* Session color depth */
settings->color_depth = settings->color_depth =
guac_user_parse_args_int(user, GUAC_RDP_CLIENT_ARGS, argv, guac_user_parse_args_int(user, GUAC_RDP_CLIENT_ARGS, argv,
@ -1305,7 +1327,9 @@ void guac_rdp_push_settings(guac_rdp_settings* guac_settings, freerdp* rdp) {
/* Order support */ /* Order support */
#ifdef LEGACY_RDPSETTINGS #ifdef LEGACY_RDPSETTINGS
bitmap_cache = rdp_settings->bitmap_cache; rdp_settings->bitmap_cache = !guac_settings->disable_bitmap_caching;
bitmap_cache = !guac_settings->disable_bitmap_caching;
rdp_settings->offscreen_bitmap_cache = !guac_settings->disable_offscreen_caching;
rdp_settings->os_major_type = OSMAJORTYPE_UNSPECIFIED; rdp_settings->os_major_type = OSMAJORTYPE_UNSPECIFIED;
rdp_settings->os_minor_type = OSMINORTYPE_UNSPECIFIED; rdp_settings->os_minor_type = OSMINORTYPE_UNSPECIFIED;
rdp_settings->desktop_resize = TRUE; rdp_settings->desktop_resize = TRUE;
@ -1334,7 +1358,9 @@ void guac_rdp_push_settings(guac_rdp_settings* guac_settings, freerdp* rdp) {
rdp_settings->order_support[NEG_ELLIPSE_SC_INDEX] = FALSE; rdp_settings->order_support[NEG_ELLIPSE_SC_INDEX] = FALSE;
rdp_settings->order_support[NEG_ELLIPSE_CB_INDEX] = FALSE; rdp_settings->order_support[NEG_ELLIPSE_CB_INDEX] = FALSE;
#else #else
bitmap_cache = rdp_settings->BitmapCacheEnabled; rdp_settings->BitmapCacheEnabled = !guac_settings->disable_bitmap_caching;
bitmap_cache = !guac_settings->disable_bitmap_caching;
rdp_settings->OffscreenSupportLevel = !guac_settings->disable_offscreen_caching;
rdp_settings->OsMajorType = OSMAJORTYPE_UNSPECIFIED; rdp_settings->OsMajorType = OSMAJORTYPE_UNSPECIFIED;
rdp_settings->OsMinorType = OSMINORTYPE_UNSPECIFIED; rdp_settings->OsMinorType = OSMINORTYPE_UNSPECIFIED;
rdp_settings->DesktopResize = TRUE; rdp_settings->DesktopResize = TRUE;

View File

@ -299,6 +299,18 @@ typedef struct guac_rdp_settings {
*/ */
int menu_animations_enabled; int menu_animations_enabled;
/**
* Whether bitmap caching should be disabled. By default it is
* enabled - this allows users to explicitly disable it.
*/
int disable_bitmap_caching;
/**
* Whether offscreen caching should be disabled. By default it is
* enabled - this allows users to explicitly disable it.
*/
int disable_offscreen_caching;
/** /**
* The preconnection ID to send within the preconnection PDU when * The preconnection ID to send within the preconnection PDU when
* initiating an RDP connection, if any. If no preconnection ID is * initiating an RDP connection, if any. If no preconnection ID is