16 About delegate of MacOS RustDesk
RustDesk edited this page 2024-03-27 15:56:20 +08:00

We have two most important delegate events, one is openURL (url schema) via browser, another one is launchpad click.

When --server is running, the delegate events will be captured by --server background process, the delegate listeners are registered in tao crate. It also may be captured by --service which caused launchpad click failure, here is a fix for this. When --server receives the delegate, it will check if there is RustDesk window.

  • If there is, --server will send url schema via ipc.
  • If there is not, --server will run command rustdesk <url-schema>, url schema will be sent to main.dart directly via args.

When --server is not running, the openURL delegate events will be sent to RustDesk window directly in two ways,

  1. No window opened while receiving the url schema, here.
  2. Window already open while receiving the url schema, here, and we have a stupid bug fix for this.

the openURL delegate listen is registered in uni_links_desktop, the url schema will be propogated to dart via uni_links_desktop. launchpad click delegate event listener is registered here.