Skip to content
This repository has been archived by the owner on Feb 13, 2024. It is now read-only.

Commit

Permalink
Always close the window in focus with cmd+w (mac), closes #2511
Browse files Browse the repository at this point in the history
  • Loading branch information
IndrekV committed Jul 23, 2018
1 parent c37b89f commit 00e4fa9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/ui/osx/TogglDesktop/test2/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -1141,7 +1141,10 @@ - (IBAction)onPreferencesMenuItem:(id)sender

- (IBAction)onHideMenuItem:(id)sender
{
[self.mainWindowController.window close];
NSArray *orderedWindows = [NSApp orderedWindows];
NSWindow *frontWindow = orderedWindows[0];

[frontWindow close];
}

- (void)onQuitMenuItem
Expand Down
2 changes: 1 addition & 1 deletion src/ui/osx/TogglDesktop/test2/Base.lproj/MainMenu.xib
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="8qb-je-u7S"/>
<menuItem title="Hide Main Window" keyEquivalent="w" id="O2e-Kb-cHX">
<menuItem title="Close Window" keyEquivalent="w" id="O2e-Kb-cHX">
<connections>
<action selector="onHideMenuItem:" target="494" id="dJX-ZW-bid"/>
</connections>
Expand Down

0 comments on commit 00e4fa9

Please sign in to comment.