@@ -1052,26 +1052,20 @@ class MainWindowController: PlayerWindowController {
1052
1052
// MARK: - Window delegate: Open / Close
1053
1053
1054
1054
func windowWillOpen( ) {
1055
- if #available( macOS 12 , * ) {
1056
- // Apparently Apple fixed AppKit for Monterey so the workaround below is only needed for
1057
- // previous versions of macOS. Support for #unavailable is coming in Swift 5.6. The version of
1058
- // Xcode being used at the time of this writing supports Swift 5.5.
1059
- } else {
1060
- // Must workaround an AppKit defect in earlier versions of macOS. This defect is known to
1061
- // exist in Catalina and Big Sur. The problem was not reproducible in Monterey. The status of
1062
- // other versions of macOS is unknown, however the workaround should be safe to apply in any
1063
- // version of macOS. The problem was reported in issues #3159, #3097 and #3253. The titles of
1064
- // open windows shown in the "Window" menu are automatically managed by the AppKit framework.
1065
- // To improve performance PlayerCore caches and reuses player instances along with their
1066
- // windows. This technique is valid and recommended by Apple. But in older versions of macOS,
1067
- // if a window is reused the framework will display the title first used for the window in the
1068
- // "Window" menu even after IINA has updated the title of the window. This problem can also be
1069
- // seen when right-clicking or control-clicking the IINA icon in the dock. As a workaround
1070
- // reset the window's title to "Window" before it is reused. This is the default title AppKit
1071
- // assigns to a window when it is first created. Surprising and rather disturbing this works
1072
- // as a workaround, but it does.
1073
- window!. title = " Window "
1074
- }
1055
+ // Must workaround an AppKit defect in some versions of macOS. This defect is known to exist in
1056
+ // Catalina and Big Sur. The problem was not reproducible in early versions of Monterey. It
1057
+ // reappeared in Ventura. The status of other versions of macOS is unknown, however the
1058
+ // workaround should be safe to apply in any version of macOS. The problem was reported in
1059
+ // issues #4229, #3159, #3097 and #3253. The titles of open windows shown in the "Window" menu
1060
+ // are automatically managed by the AppKit framework. To improve performance PlayerCore caches
1061
+ // and reuses player instances along with their windows. This technique is valid and recommended
1062
+ // by Apple. But in some versions of macOS, if a window is reused the framework will display the
1063
+ // title first used for the window in the "Window" menu even after IINA has updated the title of
1064
+ // the window. This problem can also be seen when right-clicking or control-clicking the IINA
1065
+ // icon in the dock. As a workaround reset the window's title to "Window" before it is reused.
1066
+ // This is the default title AppKit assigns to a window when it is first created. Surprising and
1067
+ // rather disturbing this works as a workaround, but it does.
1068
+ window!. title = " Window "
1075
1069
1076
1070
// As there have been issues in this area, log details about the screen selection process.
1077
1071
NSScreen . log ( " window!.screen " , window!. screen)
0 commit comments