From c400868026282c598fd5c575a7a1be424dd7eb66 Mon Sep 17 00:00:00 2001 From: Maarten Billemont Date: Tue, 4 Jun 2013 21:31:02 -0400 Subject: [PATCH] Activate before no-user alert. [FIXED] Also activate app before no-user alert. --- External/RHStatusItemView | 2 +- MasterPassword/ObjC/Mac/MPMacAppDelegate.m | 10 ++++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/External/RHStatusItemView b/External/RHStatusItemView index eb8b21e1..fa01dea4 160000 --- a/External/RHStatusItemView +++ b/External/RHStatusItemView @@ -1 +1 @@ -Subproject commit eb8b21e117bfa5747d67394f06df400ac4c94279 +Subproject commit fa01dea4ec70d12a8b2db48e26b50271451a16e1 diff --git a/MasterPassword/ObjC/Mac/MPMacAppDelegate.m b/MasterPassword/ObjC/Mac/MPMacAppDelegate.m index 402b6ff3..08ab0bd9 100644 --- a/MasterPassword/ObjC/Mac/MPMacAppDelegate.m +++ b/MasterPassword/ObjC/Mac/MPMacAppDelegate.m @@ -384,17 +384,15 @@ static OSStatus MPHotKeyHander(EventHandlerCallRef nextHandler, EventRef theEven } - (IBAction)showPasswordWindow:(id)sender { - + + [NSApp activateIgnoringOtherApps:YES]; + // If no user, can't activate. - if (YES || ![self activeUserForThread]) { + if (![self activeUserForThread]) { [[NSAlert alertWithMessageText:@"No User Selected" defaultButton:[PearlStrings get].commonButtonOkay alternateButton:nil otherButton:nil informativeTextWithFormat:@"Begin by selecting or creating your user from the status menu (●●●|) next to the clock.", nil] runModal]; return; } - // Activate the app if not active. - if (![[NSApplication sharedApplication] isActive]) - [[NSApplication sharedApplication] activateIgnoringOtherApps:YES]; - // Don't show window if we weren't already running (ie. if we haven't been activated before). if (!self.passwordWindow) self.passwordWindow = [[MPPasswordWindowController alloc] initWithWindowNibName:@"MPPasswordWindowController"];