Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GUACAMOLE-1026: Add support for FreeRDP3. #517

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

GUACAMOLE-1026: Add support for FreeRDP3. #517

wants to merge 2 commits into from

Conversation

aleitner
Copy link
Contributor

@aleitner aleitner commented May 9, 2024

Refactored to support both FreeRDP 2 and 3.

  • Added version checking for FreeRDP 3.x and fallback to 2 if 3 doesn't exist
  • Additional checks introduced for various FreeRDP 3.x feature support
    • _aligned_free and _aligned_malloc renamed to winpr_aligned_free and winpr_aligned_malloc
    • ReadColor and WriteColor renamed to FreeRDPReadColor and FreeRDPWriteColor
    • Various CLIPRDR properties moved to CLIPRDR_HEADER common struct for CLIPRDR structs.
    • Required use of getter/setter functions interacting with rdpSettings
      • freerdp_settings_set_pointer, freerdp_settings_set_bool, freerdp_settings_set_string, freerdp_settings_set_uint32, freerdp_settings_get_pointer_writable, freerdp_settings_get_bool, freerdp_settings_get_string, freerdp_settings_get_uint32
      • Note: freerdp_settings_set_pointer and freerdp_settings_get_pointer_writable were only added for 3.X where as the rest were available within 2.X.
      • getter/setter functions within 3.X now use updated enum types for keys prefixed with FreeRDP_.
    • FreeRDP 3.X moved context-related pointers (rdpSettings* settings, rdpInput* input) to a context structure in the freerdp* instance.
    • freerdp_shall_disconnect renamed to freerdp_shall_disconnect_context.
    • IDRDYNVC_ENTRY_POINTS.GetPluginData() return now requires const.
    • glyph.New and pointer.Set no longer require arguments to be const.

@aleitner aleitner marked this pull request as ready for review May 9, 2024 05:39
Copy link
Contributor

@necouchman necouchman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple of initial comments - overall looks pretty clean!

configure.ac Outdated
then
AC_CHECK_MEMBERS([freerdp.VerifyCertificateEx],,,
[[#include <freerdp/freerdp.h>]])
[[#include <freerdp/freerdp.h>]])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There seem to be some alignment issues throughout the configure.ac file, now. If we're sticking to how things are generally done throughout the file, the start of this should be aligned with the [freerdp.VerifyCertificateEx] line above, but it seems to be less indented, now.. There are several of these occurrences throughout the changes in the file.

Copy link
Contributor Author

@aleitner aleitner May 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated formatting

Nevermind looks like my editor is rendering differently than github

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be cleaner now

src/libguac/string.c Show resolved Hide resolved

}

/* Set individual flags - some FreeRDP versions overwrite the above */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overwrite which things above?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The guac_rdp_get_performance_flags function is called prior to this and that has some of the same settings.

freerdp_settings_set_uint32(rdp_settings, FreeRDP_PerformanceFlags, guac_rdp_get_performance_flags(guac_settings));

static int guac_rdp_get_performance_flags(guac_rdp_settings* guac_settings) {
/* No performance flags initially */
int flags = PERF_FLAG_NONE;
/* Desktop wallpaper */
if (!guac_settings->wallpaper_enabled)
flags |= PERF_DISABLE_WALLPAPER;
/* Theming of desktop/windows */
if (!guac_settings->theming_enabled)
flags |= PERF_DISABLE_THEMING;
/* Font smoothing (ClearType) */
if (guac_settings->font_smoothing_enabled)
flags |= PERF_ENABLE_FONT_SMOOTHING;
/* Full-window drag */
if (!guac_settings->full_window_drag_enabled)
flags |= PERF_DISABLE_FULLWINDOWDRAG;
/* Desktop composition (Aero) */
if (guac_settings->desktop_composition_enabled)
flags |= PERF_ENABLE_DESKTOP_COMPOSITION;
/* Menu animations */
if (!guac_settings->menu_animations_enabled)
flags |= PERF_DISABLE_MENUANIMATIONS;
return flags;
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So "the above" means "flags set by guac_rdp_get_performance_flags() above"?

If so, mind updating the comment to be a bit more specific?

@aleitner aleitner force-pushed the RDP-3 branch 4 times, most recently from 6d1b313 to daceeaf Compare May 10, 2024 01:17
@necouchman
Copy link
Contributor

I need to pull the code down and actually run it through some testing before I'm good with it, I'll try to get that done this weekend.

Currently this is targeted at the main branch which would put it in the 1.6.0 release. In the past I think it was mentioned that this might go into a 2.0 release, so wanted to check and see if @mike-jumper or @jmuehlner had any thoughts on that? I'm fine with it going into 1.6.0 - it seems like it's a pretty minimal and compatible set of changes, just want to make sure we're all in agreement.

@jmuehlner
Copy link
Contributor

I need to pull the code down and actually run it through some testing before I'm good with it, I'll try to get that done this weekend.

Currently this is targeted at the main branch which would put it in the 1.6.0 release. In the past I think it was mentioned that this might go into a 2.0 release, so wanted to check and see if @mike-jumper or @jmuehlner had any thoughts on that? I'm fine with it going into 1.6.0 - it seems like it's a pretty minimal and compatible set of changes, just want to make sure we're all in agreement.

It doesn't drop compatibility with FreeRDP 2.x so I'm fine putting it in main, and in 1.6.0.

@mike-jumper
Copy link
Contributor

No objection from me for inclusion in 1.6.0 either as long as we maintain compatibility with FreeRDP 2.x.

@mike-jumper
Copy link
Contributor

mike-jumper commented May 22, 2024

I've added this temporary build to help verify these changes against various 2.x and 3.x versions of FreeRDP:

https://ci-builds.apache.org/job/Guacamole/job/guacamole-server-wip-freerdp3/

The above is identical to our existing build except that it builds against this RDP-3 branch (not main) and includes FreeRDP's main and latest 3.x release as additional versions to be tested.

@jmuehlner
Copy link
Contributor

I've added this temporary build to help verify these changes against various 2.x and 3.x versions of FreeRDP:

https://ci-builds.apache.org/job/Guacamole/job/guacamole-server-wip-freerdp3/

The above is identical to our existing build except that it builds against this RDP-3 branch (not main) and includes FreeRDP's main and latest 3.x release as additional versions to be tested.

Looks like the FreeRDP 3 test build failed: https://ci-builds.apache.org/job/Guacamole/job/guacamole-server-wip-freerdp3/FREERDP_BRANCH=3.5.1,JENKINS_LABEL_EXPRESSION=ubuntu/lastBuild/console

@aleitner
Copy link
Contributor Author

I've added this temporary build to help verify these changes against various 2.x and 3.x versions of FreeRDP:
https://ci-builds.apache.org/job/Guacamole/job/guacamole-server-wip-freerdp3/
The above is identical to our existing build except that it builds against this RDP-3 branch (not main) and includes FreeRDP's main and latest 3.x release as additional versions to be tested.

Looks like the FreeRDP 3 test build failed: https://ci-builds.apache.org/job/Guacamole/job/guacamole-server-wip-freerdp3/FREERDP_BRANCH=3.5.1,JENKINS_LABEL_EXPRESSION=ubuntu/lastBuild/console

Huh that shouldn't happen. I just pushed changes a little bit ago to resolve that

@jmuehlner
Copy link
Contributor

Huh that shouldn't happen. I just pushed changes a little bit ago to resolve that

Ah ok - looks like a new build did kick off a bit ago - maybe that'll fix it.
https://ci-builds.apache.org/job/Guacamole/job/guacamole-server-wip-freerdp3/2/

@jmuehlner
Copy link
Contributor

Huh that shouldn't happen. I just pushed changes a little bit ago to resolve that

Ah ok - looks like a new build did kick off a bit ago - maybe that'll fix it. https://ci-builds.apache.org/job/Guacamole/job/guacamole-server-wip-freerdp3/2/

Looks like it failed again... https://ci-builds.apache.org/job/Guacamole/job/guacamole-server-wip-freerdp3/2/FREERDP_BRANCH=3.5.1,JENKINS_LABEL_EXPRESSION=ubuntu/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants