Fix warning: zoomAll / makeWindowsPerform

Fix the deprecation warning on makeWindowsPerform. While we could simply
replace it with the more updated form, one thing I noticed was that
zoomAll: simply wasn't getting called. It appears that NSApplication has
a native handler of it and would call zoom: on each window by itself,
and as such there's no point in making our own zoomAll: method at all. I
couldn't find out if this was the case in old macOS versions, and so
just ifdef out the zoomAll function in newer versions of macOS which
also fixes the deprecation warning.
This commit is contained in:
Yee Cheng Chin
2022-10-05 18:44:02 -07:00
parent dc1ad365de
commit c41e05baac
2 changed files with 10 additions and 0 deletions
+2
View File
@@ -73,7 +73,9 @@
- (IBAction)showVimHelp:(id)sender withCmd:(NSString *)cmd;
- (IBAction)showVimHelp:(id)sender;
- (IBAction)checkForUpdates:(id)sender;
#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_13
- (IBAction)zoomAll:(id)sender;
#endif
- (IBAction)stayInFront:(id)sender;
- (IBAction)stayInBack:(id)sender;
- (IBAction)stayLevelNormal:(id)sender;
+8
View File
@@ -1315,11 +1315,19 @@ fsEventCallback(ConstFSEventStreamRef streamRef,
#endif
}
// Note that the zoomAll method does not appear to be called in modern macOS versions
// as NSApplication just handles it and directly calls each window's zoom:. It's
// difficult to trace through history to see when that happened as it's not really
// documented, so we are leaving this method around in case on older macOS
// versions it's useful.
#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_13
- (IBAction)zoomAll:(id)sender
{
// TODO ychin: check on 10.13 etc. This was depreacated post 10.14.
ASLogDebug(@"Zoom all windows");
[NSApp makeWindowsPerform:@selector(performZoom:) inOrder:YES];
}
#endif
- (IBAction)stayInFront:(id)sender
{