Merge pull request #4255 from Kingtous/feat/plugins
fix: window on top when url scheme received from ipc
This commit is contained in:
commit
e3daa66125
@ -1581,13 +1581,7 @@ bool checkArguments() {
|
|||||||
/// Returns true if we successfully handle the uri provided.
|
/// Returns true if we successfully handle the uri provided.
|
||||||
/// [Functions]
|
/// [Functions]
|
||||||
/// 1. New Connection: rustdesk://connection/new/your_peer_id
|
/// 1. New Connection: rustdesk://connection/new/your_peer_id
|
||||||
/// 2. Bring the main window to the top: empty uriPath
|
|
||||||
bool parseRustdeskUri(String uriPath) {
|
bool parseRustdeskUri(String uriPath) {
|
||||||
// If we invoke uri with blank path, we just bring the main window to tht top.
|
|
||||||
if (uriPath.isEmpty) {
|
|
||||||
window_on_top(null);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
final uri = Uri.tryParse(uriPath);
|
final uri = Uri.tryParse(uriPath);
|
||||||
if (uri == null) {
|
if (uri == null) {
|
||||||
debugPrint("uri is not valid: $uriPath");
|
debugPrint("uri is not valid: $uriPath");
|
||||||
|
@ -211,7 +211,12 @@ class FfiModel with ChangeNotifier {
|
|||||||
parent.target?.elevationModel.onPortableServiceRunning(evt);
|
parent.target?.elevationModel.onPortableServiceRunning(evt);
|
||||||
} else if (name == 'on_url_scheme_received') {
|
} else if (name == 'on_url_scheme_received') {
|
||||||
final url = evt['url'].toString();
|
final url = evt['url'].toString();
|
||||||
|
// If we invoke uri with blank path, we just bring the main window to the top.
|
||||||
|
if (url.isEmpty) {
|
||||||
|
window_on_top(null);
|
||||||
|
} else {
|
||||||
parseRustdeskUri(url);
|
parseRustdeskUri(url);
|
||||||
|
}
|
||||||
} else if (name == 'on_voice_call_waiting') {
|
} else if (name == 'on_voice_call_waiting') {
|
||||||
// Waiting for the response from the peer.
|
// Waiting for the response from the peer.
|
||||||
parent.target?.chatModel.onVoiceCallWaiting();
|
parent.target?.chatModel.onVoiceCallWaiting();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user