macos: keep window hidden during launch

This commit is contained in:
Rikard Braathen 2021-12-15 16:10:47 +01:00
parent b81d020d26
commit d07c3c83f0
No known key found for this signature in database
GPG Key ID: BB568D1A81F6A965
2 changed files with 12 additions and 1 deletions

View File

@ -2,21 +2,27 @@ PODS:
- FlutterMacOS (1.0.0)
- shared_preferences_macos (0.0.1):
- FlutterMacOS
- window_manager (0.1.0):
- FlutterMacOS
DEPENDENCIES:
- FlutterMacOS (from `Flutter/ephemeral`)
- shared_preferences_macos (from `Flutter/ephemeral/.symlinks/plugins/shared_preferences_macos/macos`)
- window_manager (from `Flutter/ephemeral/.symlinks/plugins/window_manager/macos`)
EXTERNAL SOURCES:
FlutterMacOS:
:path: Flutter/ephemeral
shared_preferences_macos:
:path: Flutter/ephemeral/.symlinks/plugins/shared_preferences_macos/macos
window_manager:
:path: Flutter/ephemeral/.symlinks/plugins/window_manager/macos
SPEC CHECKSUMS:
FlutterMacOS: 57701585bf7de1b3fc2bb61f6378d73bbdea8424
shared_preferences_macos: 480ce071d0666e37cef23fe6c702293a3d21799e
window_manager: db713621c322d52e96064336a4ba2b7e4e30c94f
PODFILE CHECKSUM: 6eac6b3292e5142cfc23bdeb71848a40ec51c14c
COCOAPODS: 1.10.1
COCOAPODS: 1.11.2

View File

@ -1,5 +1,6 @@
import Cocoa
import FlutterMacOS
import window_manager
class MainFlutterWindow: NSWindow {
override func awakeFromNib() {
@ -12,4 +13,8 @@ class MainFlutterWindow: NSWindow {
super.awakeFromNib()
}
override public func order(_ place: NSWindow.OrderingMode, relativeTo otherWin: Int) {
super.order(place, relativeTo: otherWin)
hiddenWindowAtLaunch()
}
}