adborc
adborc copied to clipboard
`stop-scrcpy` doesn't work if Consumer and Supplier are same
#12 Added ability to stop device screen mirroring. It stops the mirroring by closing the tunnels established for scrcpy
. This doesn't work if both the Consumer and Supplier are on the same machine as no scrcpy tunnels are established if they are on the same machine. Need another way to stop the screen mirroring.
This issue only affects Windows. This is because In addition to closing the scrcpy tunnels, we also kill the child scrcpy process. The problem is, the scrcpy window runs in a separate thread (with a different pid) from the child process. The scrcpy window closes in *nix platforms when SIGKILL is sent to the original scrcpy thread (which is what we send), but if SIGTERM is sent, the window doesn't close.
Not exactly sure what the behavior of kill signals is on Windows (neither do I know, what signal exactly is sent from our side). Need to investigate this further.
See https://github.com/Genymobile/scrcpy/issues/3639 for more details on this issue.