Detect if shift key is held down ASAP when launching test app

This commit is contained in:
Zorg committed 2016-08-14 13:44:10 -04:00
1 parent 57325c7507
commit bbfcd564d2
3 files changed
+18 -2

No files matched your search

@@ -13,6 +13,7 @@
@interface SUUpdateSettingsWindowController ()
@property (nonatomic) SPUUpdater *updater;
@property (nonatomic, readonly) BOOL customUserDriver;
@property (nonatomic) id<SPUStandardUserDriverProtocol> userDriver;
@end
@@ -20,8 +21,18 @@
@implementation SUUpdateSettingsWindowController
@synthesize updater = _updater;
@synthesize customUserDriver = _customUserDriver;
@synthesize userDriver = _userDriver;
- (instancetype)initWithCustomUserDriver:(BOOL)customUserDriver
{
self = [super init];
if (self != nil) {
_customUserDriver = customUserDriver;
}
return self;
}
- (NSString *)windowNibName
{
return NSStringFromClass([self class]);
@@ -34,7 +45,7 @@
// If the user is holding down command, we use the popup title user driver instead
id<SPUUserDriver, SPUStandardUserDriverProtocol> userDriver;
if (([NSEvent modifierFlags] & NSShiftKeyMask) != 0) {
if (self.customUserDriver) {
userDriver = [[SUPopUpTitlebarUserDriver alloc] initWithApplicationBundle:applicationBundle window:self.window];
} else {
userDriver = [[SPUStandardUserDriver alloc] initWithHostBundle:hostBundle applicationBundle:applicationBundle delegate:nil];