mirror of
https://github.com/weyne85/rustdesk.git
synced 2025-10-29 17:00:05 +00:00
fix: --connect command on macOS & window closing issues
This commit is contained in:
@@ -3,21 +3,22 @@ import FlutterMacOS
|
||||
|
||||
@NSApplicationMain
|
||||
class AppDelegate: FlutterAppDelegate {
|
||||
var lauched = false;
|
||||
var launched = false;
|
||||
override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool {
|
||||
dummy_method_to_enforce_bundling()
|
||||
return true
|
||||
// https://github.com/leanflutter/window_manager/issues/214
|
||||
return false
|
||||
}
|
||||
|
||||
override func applicationShouldOpenUntitledFile(_ sender: NSApplication) -> Bool {
|
||||
if (lauched) {
|
||||
if (launched) {
|
||||
handle_applicationShouldOpenUntitledFile();
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
override func applicationDidFinishLaunching(_ aNotification: Notification) {
|
||||
lauched = true;
|
||||
launched = true;
|
||||
NSApplication.shared.activate(ignoringOtherApps: true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,8 +23,10 @@
|
||||
<dict>
|
||||
<key>CFBundleTypeRole</key>
|
||||
<string>Editor</string>
|
||||
<key>CFBundleURLName</key>
|
||||
<key>CFBundleURLIconFile</key>
|
||||
<string></string>
|
||||
<key>CFBundleURLName</key>
|
||||
<string>com.carriez.rustdesk</string>
|
||||
<key>CFBundleURLSchemes</key>
|
||||
<array>
|
||||
<string>rustdesk</string>
|
||||
@@ -35,13 +37,13 @@
|
||||
<string>$(FLUTTER_BUILD_NUMBER)</string>
|
||||
<key>LSMinimumSystemVersion</key>
|
||||
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
|
||||
<key>LSUIElement</key>
|
||||
<string>1</string>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
<string>$(PRODUCT_COPYRIGHT)</string>
|
||||
<key>NSMainNibFile</key>
|
||||
<string>MainMenu</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
<string>NSApplication</string>
|
||||
<key>LSUIElement</key>
|
||||
<string>1</string>
|
||||
<string>NSApplication</string>
|
||||
</dict>
|
||||
</plist>
|
||||
|
||||
@@ -78,6 +78,9 @@ class MainFlutterWindow: NSWindow {
|
||||
self.setWindowInterfaceMode(window: window,themeName: themeName ?? "light")
|
||||
result(nil)
|
||||
break;
|
||||
case "terminate":
|
||||
NSApplication.shared.terminate(self)
|
||||
result(nil)
|
||||
default:
|
||||
result(FlutterMethodNotImplemented)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user