Skip to content

Rebase RDP-RAIL support from microsoft's mirror

gpotter2 requested to merge gpotter2/weston:master into main

Hi everyone, thanks a lot for your work on this great project.

To give a little bit of context, this PR is a rebase of the "RDP-RAIL" feature that was added on Microsoft's weston fork back in 2020-2021. I think it's a very cool feature, here's a little demo of me using RDP/RAIL from a Windows machine to a distant linux machine (This was captured in a Windows VM, excuse the lag 😞 ..):

Recording_2025-01-02_234341

I'm proposing this PR because I'm a bit unsure Microsoft will actually upstream those changes themselves, and was willing to make the work to adapt it. The two repos have diverged A LOT over the years, and I think that it is becoming harder and harder to merge the two repos. (It took me a fulltime week of fixing conflicts and cherry-picking parts...). I think it was also a missed opportunity for those features not to have been merged sooner: RAIL (and it's variant VAIL) is used by Microsoft in wslg, which itself is used by a lot of people. Eventually, people encounter bugs, find issues and get fixes that would also benefit weston. (e.g. here, here or here, etc.)

To give slightly more context, this includes most changes that are either RAIL-related, or bugfixes, since the original split: "Merged PR 4742168: Add preliminary RDP-RAIL support for weston" (link to the commit).

The code was heavily adapted to fix conflicts and generally use more modern things (like the global_coord instead of x,y, this kind of things). I have stripped a few things, however, that were either not ready or that weren't relevant to weston:

  • the "wslgd-notify" module, which is very wsl-specific.
  • the changes to compositor/rdp*.c (new files, not to be confused with libweston/backend-rdp/rdpdisp.c). Those added things like sound and clipboard support before it was really a thing elsewhere (so it's not really required anymore). It however also added handling of multi-monitor layouts (for things like minimizing, etc.). Those changes are found in compositor/rdpdisp.c in their fork. This isn't working out of the box, and as it is not necessary, I chose to drop it.
  • the audio (through pulseaudio) additions aren't included. I plan to submit them in a separate PR.

Some other comments or liberties I took:

  • I have merged their 'rdprail-shell' folder with the 'desktop-shell' because they basically copy/pasted 'desktop-shell' and modified it slightly to make 'rdprail-shell'. This reduces duplicated code by so much that I think it's worth it. 'rdprail-shell.so' ends up being a symbolink link to 'desktop-shell.so', and we detect which one is which on start (and store it in shell->rail).
  • I have merged their additions of SVG handling directly in image-loader to be consistent with what weston handles.
  • I have included the app-list.c plugin. This could doesn't really have a use until the applist channel is implemented in xfreerdp (it's already impelmented in wslg), but I felt like it would benefit from being kept up to date.

Disclaimer notes

This PR requires the following fixes in FreeRDP:

A word on the review of this PR

I'm already sorry about several things:

  1. the PR takes the form of a giant commit. Sadly, rebasing 200+ commits individually was too much work. This PR all in all restricts to adding "RAIL support", but it sucks a bit. I also know that it could have been splitted in smaller parts, for instance !824, but that would also have required tremendous work. I know this is hard to review. On the other hand it's mostly feature-complete.
  2. this PR might include styling changes that are not really cool with the rest of weston. I will fix any that is reported during the review process, very sorry about that. Feel free to say it needs to be pretty-fied before the review happens and I'll try improve it.

Tests are currently failing because the runner is missing librsvg-2.0. Should I set the option to off by default?

Edited by gpotter2

Merge request reports

Loading