@@ -62,14 +62,32 @@ extension AppKitOrUIKitHostingWindowProtocol {
62
62
#endif
63
63
64
64
@_documentation ( visibility: internal)
65
- public struct _AppKitOrUIKitHostingWindowConfiguration : Equatable {
66
- public var style : _WindowStyle = . default
65
+ public struct _AppKitOrUIKitHostingWindowConfiguration : Hashable , Sendable {
66
+ public var style : _WindowStyle
67
67
public var canBecomeKey : Bool ?
68
68
public var allowTouchesToPassThrough : Bool ?
69
69
public var windowPosition : _CoordinateSpaceRelative < CGPoint > ?
70
70
public var isTitleBarHidden : Bool ?
71
71
public var backgroundColor : Color ?
72
72
public var preferredColorScheme : ColorScheme ?
73
+
74
+ public init (
75
+ style: _WindowStyle = . default,
76
+ canBecomeKey: Bool ? = nil ,
77
+ allowTouchesToPassThrough: Bool ? = nil ,
78
+ windowPosition: _CoordinateSpaceRelative < CGPoint > ? = nil ,
79
+ isTitleBarHidden: Bool ? = nil ,
80
+ backgroundColor: Color ? = nil ,
81
+ preferredColorScheme: ColorScheme ? = nil
82
+ ) {
83
+ self . style = style
84
+ self . canBecomeKey = canBecomeKey
85
+ self . allowTouchesToPassThrough = allowTouchesToPassThrough
86
+ self . windowPosition = windowPosition
87
+ self . isTitleBarHidden = isTitleBarHidden
88
+ self . backgroundColor = backgroundColor
89
+ self . preferredColorScheme = preferredColorScheme
90
+ }
73
91
74
92
public mutating func mergeInPlace( with other: Self ) {
75
93
self . canBecomeKey = other. canBecomeKey ?? self . canBecomeKey
@@ -392,8 +410,12 @@ open class AppKitOrUIKitHostingWindow<Content: View>: AppKitOrUIKitWindow, AppKi
392
410
hasShadow = false
393
411
case . titleBar:
394
412
self . init ( contentViewController: contentViewController)
413
+
414
+ self . _SwiftUIX_windowConfiguration. style = style
395
415
case . _transparent:
396
416
self . init ( contentViewController: contentViewController)
417
+
418
+ self . _SwiftUIX_windowConfiguration. style = style
397
419
}
398
420
399
421
Task . detached { @MainActor in
@@ -406,6 +428,8 @@ open class AppKitOrUIKitHostingWindow<Content: View>: AppKitOrUIKitWindow, AppKi
406
428
self . contentViewController = contentViewController
407
429
}
408
430
431
+ assert ( self . _SwiftUIX_windowConfiguration. style == style)
432
+
409
433
performSetUp ( )
410
434
411
435
delegate = self
@@ -455,15 +479,17 @@ open class AppKitOrUIKitHostingWindow<Content: View>: AppKitOrUIKitWindow, AppKi
455
479
}
456
480
}
457
481
case . _transparent:
482
+ styleMask = [ . borderless, . fullSizeContentView]
458
483
collectionBehavior = [ . fullScreenPrimary]
459
484
level = . floating
460
- isMovable = false
461
485
titleVisibility = . hidden
462
486
titlebarAppearsTransparent = true
463
-
487
+ isMovable = true
488
+ isMovableByWindowBackground = true
489
+ ignoresMouseEvents = false
490
+
464
491
standardWindowButton ( . closeButton) ? . isHidden = true
465
492
standardWindowButton ( . miniaturizeButton) ? . isHidden = true
466
-
467
493
standardWindowButton ( . zoomButton) ? . isHidden = true
468
494
469
495
hasShadow = false
0 commit comments