aleitner commented on code in PR #517: URL: https://github.com/apache/guacamole-server/pull/517#discussion_r1596113631
########## src/protocols/rdp/settings.c: ########## @@ -1451,11 +1440,279 @@ static int guac_rdp_get_performance_flags(guac_rdp_settings* guac_settings) { } +int guac_rdp_get_width(freerdp* rdp) { +#ifdef HAVE_SETTERS_GETTERS + return freerdp_settings_get_uint32(rdp->context->settings, FreeRDP_DesktopWidth); +#else + return rdp->settings->DesktopWidth; +#endif +} + +int guac_rdp_get_height(freerdp* rdp) { +#ifdef HAVE_SETTERS_GETTERS + return freerdp_settings_get_uint32(rdp->context->settings, FreeRDP_DesktopHeight); +#else + return rdp->settings->DesktopHeight; +#endif +} + +int guac_rdp_get_depth(freerdp* rdp) { +#ifdef HAVE_SETTERS_GETTERS + return freerdp_settings_get_uint32(rdp->context->settings, FreeRDP_ColorDepth); +#else + return rdp->settings->ColorDepth; +#endif +} + void guac_rdp_push_settings(guac_client* client, guac_rdp_settings* guac_settings, freerdp* rdp) { - rdpSettings* rdp_settings = rdp->settings; + rdpSettings* rdp_settings = GUAC_RDP_CONTEXT(rdp)->settings; + +#ifdef HAVE_SETTERS_GETTERS + /* Authentication */ + freerdp_settings_set_string(rdp_settings, FreeRDP_Domain, guac_strdup(guac_settings->domain)); + freerdp_settings_set_string(rdp_settings, FreeRDP_Username, guac_strdup(guac_settings->username)); + freerdp_settings_set_string(rdp_settings, FreeRDP_Password, guac_strdup(guac_settings->password)); + + /* Connection */ + freerdp_settings_set_string(rdp_settings, FreeRDP_ServerHostname, guac_strdup(guac_settings->hostname)); + freerdp_settings_set_uint32(rdp_settings, FreeRDP_ServerPort, guac_settings->port); + + /* Session */ + + freerdp_settings_set_uint32(rdp_settings, FreeRDP_DesktopWidth, guac_settings->width); + freerdp_settings_set_uint32(rdp_settings, FreeRDP_DesktopHeight, guac_settings->height); + freerdp_settings_set_uint32(rdp_settings, FreeRDP_ColorDepth, guac_settings->color_depth); + freerdp_settings_set_string(rdp_settings, FreeRDP_AlternateShell, guac_strdup(guac_settings->initial_program)); + freerdp_settings_set_uint32(rdp_settings, FreeRDP_KeyboardLayout, guac_settings->server_layout->freerdp_keyboard_layout); + + + /* Performance flags */ + /* Explicitly set flag value */ + freerdp_settings_set_uint32(rdp_settings, FreeRDP_PerformanceFlags, guac_rdp_get_performance_flags(guac_settings)); + + /* Always request frame markers */ + freerdp_settings_set_bool(rdp_settings, FreeRDP_FrameMarkerCommandEnabled, TRUE); + freerdp_settings_set_bool(rdp_settings, FreeRDP_SurfaceFrameMarkerEnabled, TRUE); + + /* Enable RemoteFX / Graphics Pipeline */ + if (guac_settings->enable_gfx) { + + freerdp_settings_set_bool(rdp_settings, FreeRDP_SupportGraphicsPipeline, TRUE); + freerdp_settings_set_bool(rdp_settings, FreeRDP_RemoteFxCodec, TRUE); + + if (freerdp_settings_get_uint32(rdp_settings, FreeRDP_ColorDepth) != RDP_GFX_REQUIRED_DEPTH) { + guac_client_log(client, GUAC_LOG_WARNING, "Ignoring requested " + "color depth of %i bpp, as the RDP Graphics Pipeline " + "requires %i bpp.", freerdp_settings_get_uint32(rdp_settings, FreeRDP_ColorDepth), RDP_GFX_REQUIRED_DEPTH); + } + + /* Required for RemoteFX / Graphics Pipeline */ + freerdp_settings_set_bool(rdp_settings, FreeRDP_FastPathOutput, TRUE); + freerdp_settings_set_uint32(rdp_settings, FreeRDP_ColorDepth, RDP_GFX_REQUIRED_DEPTH); + freerdp_settings_set_bool(rdp_settings, FreeRDP_SoftwareGdi, TRUE); + + } + + /* Set individual flags - some FreeRDP versions overwrite the above */ Review Comment: The `guac_rdp_get_performance_flags` function is called prior to this and that has some of the same settings. https://github.com/apache/guacamole-server/blob/32d232a44a1cd9cf7a4e99e6b63e0df3830f50f6/src/protocols/rdp/settings.c#L1493 https://github.com/apache/guacamole-server/blob/32d232a44a1cd9cf7a4e99e6b63e0df3830f50f6/src/protocols/rdp/settings.c#L1410-L1441 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@guacamole.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org