@@ -374,22 +374,31 @@ extension MenuBarItemManager {
374
374
enum ErrorCode : Int , CustomStringConvertible {
375
375
/// An operation could not be completed.
376
376
case couldNotComplete
377
+
377
378
/// The creation of a menu bar item event failed.
378
379
case eventCreationFailure
380
+
379
381
/// The shared app state is invalid or could not be found.
380
382
case invalidAppState
383
+
381
384
/// An event source could not be created or is otherwise invalid.
382
385
case invalidEventSource
386
+
383
387
/// The location of the mouse cursor is invalid or could not be found.
384
388
case invalidCursorLocation
389
+
385
390
/// A menu bar item is invalid.
386
391
case invalidItem
392
+
387
393
/// A menu bar item cannot be moved.
388
394
case notMovable
395
+
389
396
/// A menu bar item event operation timed out.
390
397
case eventOperationTimeout
398
+
391
399
/// A menu bar item frame check timed out.
392
400
case frameCheckTimeout
401
+
393
402
/// An operation timed out.
394
403
case otherTimeout
395
404
@@ -537,10 +546,8 @@ extension MenuBarItemManager {
537
546
/// A string to use for logging purposes.
538
547
var logString : String {
539
548
switch self {
540
- case . leftOfItem( let item) :
541
- " left of \( item. logString) "
542
- case . rightOfItem( let item) :
543
- " right of \( item. logString) "
549
+ case . leftOfItem( let item) : " left of \( item. logString) "
550
+ case . rightOfItem( let item) : " right of \( item. logString) "
544
551
}
545
552
}
546
553
}
@@ -698,6 +705,7 @@ extension MenuBarItemManager {
698
705
699
706
Logger . itemManager. debug ( " Received \( type. logString) at \( location. logString) (item: \( item. logString) ) " )
700
707
708
+ // Disable the tap and resume the continuation.
701
709
proxy. disable ( )
702
710
continuation. resume ( )
703
711
@@ -710,6 +718,7 @@ extension MenuBarItemManager {
710
718
continuation. resume ( throwing: EventError ( code: . eventOperationTimeout, item: item) )
711
719
}
712
720
721
+ // Post the event to the location.
713
722
postEvent ( event, to: location)
714
723
}
715
724
}
@@ -1458,6 +1467,7 @@ private enum MenuBarItemEventButtonState {
1458
1467
private enum MenuBarItemEventType {
1459
1468
/// The event type for moving a menu bar item.
1460
1469
case move( MenuBarItemEventButtonState )
1470
+
1461
1471
/// The event type for clicking a menu bar item.
1462
1472
case click( MenuBarItemEventButtonState )
1463
1473
0 commit comments