Skip to content

Conversation

@KernelGhost
Copy link
Member

@KernelGhost KernelGhost commented Jan 25, 2026

This PR improves FreeRDP process lifecycle tracking, with better support for the Flatpak as well as automatic cleanup of orphaned process tracking files on startup. This PR also has the potential to address winapps-org/winapps-launcher#27.

Warning

I no longer have WinApps installed, so I’ve only been able to validate this through basic unit tests. I’d appreciate another maintainer testing the changes. Many thanks in advance.

Closes #252.

KernelGhost and others added 2 commits January 25, 2026 22:15
oskardotglobal
oskardotglobal previously approved these changes Jan 25, 2026
Copy link
Member

@oskardotglobal oskardotglobal left a comment

Choose a reason for hiding this comment

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

I can't test the flatpak changes because Flatpak on NixOS is a hassle but this looks good to me

Signed-off-by: Rohan Barar <rohan.barar@gmail.com>
Signed-off-by: Rohan Barar <rohan.barar@gmail.com>
@Maxb0tbeep
Copy link

I just tested this on Arch Linux (not flatpak) and it works as intended. I made a duplicate .cproc file so there would be an orphan file at ~/.local/share/winapps and upon connecting to a FreeRDP session it removes the orphaned file. However, it might be better (if possible) to remove orphaned files on WinApps startup for the edge case of a user experiencing the orphaned .cproc file issue and then being unable to gracefully power off without opening a FreeRDP session. I can see this happening like this:

  1. Host computer power loss (.cproc doesn't get removed)
  2. The user turns their computer back on and WinApps autostarts or is manually started
  3. The user never opens a FreeRDP session but the container/VM is running
  4. The user eventually wants to power off, hibernate, pause, etc. and the operation fails

Futhermore, an orphaned .cproc file also prevents auto pausing which I'm sure almost anyone who would autostart WinApps would have enabled.

@KernelGhost
Copy link
Member Author

@Maxb0tbeep Thanks for taking the time to test these changes! In the commits above, waCleanUp is run on script startup, so orphaned files should be cleaned up automatically when a new instance of winapps is launched. Is this sufficient to address your concerns?

@Maxb0tbeep
Copy link

@KernelGhost Interesting. The behavior that I experienced when I cloned your branch was that it only cleaned up orphaned files once a FreeRDP session was started, so starting up WinApps from the launcher (or just starting the container manually) didn't remove the files.

@KernelGhost
Copy link
Member Author

@Maxb0tbeep That behaviour is expected given the way things are currently written. Implementing cleanup at container launch would be difficult, but your described desired behaviour can certainly be added to the launcher.

To avoid having two separate projects (winapps and winapps-launcher) modifying process-lifecycle tracking files, one possible approach would be to add a new winapps command (something like 'killrdp') to the main winapps script. This command could inherit the existing FreeRDP termination logic currently present within the launcher, while also explicitly handling cleanup of the cproc files (currently not done by the launcher implementation).

The launcher would then invoke an instance of winapps with the 'killrdp' argument rather than implementing its own termination logic.

Curious to hear your thoughts on whether this approach would be acceptable?

@Maxb0tbeep
Copy link

@KernelGhost sounds good to me.

Signed-off-by: Rohan Barar <rohan.barar@gmail.com>
Signed-off-by: Rohan Barar <rohan.barar@gmail.com>
… and cleaning FreeRDP process tracking files.

Signed-off-by: Rohan Barar <rohan.barar@gmail.com>
@KernelGhost
Copy link
Member Author

@Maxb0tbeep Can you please test these changes?

@Maxb0tbeep
Copy link

@KernelGhost works for me :)

@KernelGhost
Copy link
Member Author

@Maxb0tbeep Thanks for taking a look.

@oskardotglobal would you mind proofreading and testing this alongside winapps-org/winapps-launcher#43 as a final check?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Winapps does not output any usage help when run without any arguments

3 participants