mirror of
https://github.com/sparkle-project/Sparkle
synced 2026-11-25 04:47:55 +00:00
Don't hide standard updater window on deactivation
Sometimes when the app is re-activated, the window is ordered back behind other applications. Also it may be useful to eg read the release notes when browsing another application. We still preserve the logic that defers showing the update alert when the application isn't initially frontmost.
This commit is contained in:
1 parent
0a4846a186
commit
f95bf0c7d5
3 files changed
+2
-14
No files matched your search
Vendored
+2
-2
@@ -20,12 +20,12 @@
|
||||
</customObject>
|
||||
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
|
||||
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
|
||||
<window identifier="SUUpdateAlert" title="Software Update" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" hidesOnDeactivate="YES" releasedWhenClosed="NO" visibleAtLaunch="NO" frameAutosaveName="SUUpdateAlert" animationBehavior="default" id="5" userLabel="Update Alert (release notes)">
|
||||
<window identifier="SUUpdateAlert" title="Software Update" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" visibleAtLaunch="NO" frameAutosaveName="SUUpdateAlert" animationBehavior="default" id="5" userLabel="Update Alert (release notes)">
|
||||
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
|
||||
<windowCollectionBehavior key="collectionBehavior" fullScreenAuxiliary="YES"/>
|
||||
<windowPositionMask key="initialPositionMask" topStrut="YES" bottomStrut="YES"/>
|
||||
<rect key="contentRect" x="746" y="229" width="620" height="370"/>
|
||||
<rect key="screenRect" x="0.0" y="0.0" width="1440" height="875"/>
|
||||
<rect key="screenRect" x="0.0" y="0.0" width="2560" height="1415"/>
|
||||
<value key="minSize" type="size" width="550" height="150"/>
|
||||
<view key="contentView" id="6">
|
||||
<rect key="frame" x="0.0" y="0.0" width="620" height="370"/>
|
||||
|
||||
Vendored
-5
@@ -34,11 +34,6 @@ SU_EXPORT @interface SPUStandardUserDriver : NSObject <SPUUserDriver>
|
||||
*/
|
||||
- (instancetype)initWithHostBundle:(NSBundle *)hostBundle delegate:(nullable id<SPUStandardUserDriverDelegate>)delegate;
|
||||
|
||||
/*!
|
||||
* Enable or disable hideOnDeactivate for standard update window.
|
||||
*/
|
||||
@property (nonatomic) BOOL hideOnDeactivate;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
Vendored
-7
@@ -39,7 +39,6 @@
|
||||
@synthesize delegate = _delegate;
|
||||
@synthesize checkingController = _checkingController;
|
||||
@synthesize activeUpdateAlert = _activeUpdateAlert;
|
||||
@synthesize hideOnDeactivate = _hideOnDeactivate;
|
||||
@synthesize statusController = _statusController;
|
||||
|
||||
#pragma mark Birth
|
||||
@@ -51,7 +50,6 @@
|
||||
_host = [[SUHost alloc] initWithBundle:hostBundle];
|
||||
_delegate = delegate;
|
||||
_coreComponent = [[SPUUserDriverCoreComponent alloc] init];
|
||||
_hideOnDeactivate = YES;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
@@ -83,15 +81,10 @@
|
||||
// Make sure the window is loaded in any case
|
||||
[self.activeUpdateAlert window];
|
||||
|
||||
if (!self.hideOnDeactivate) {
|
||||
[self.activeUpdateAlert.window setHidesOnDeactivate:NO];
|
||||
}
|
||||
|
||||
// If the app is a menubar app or the like, we need to focus it first and alter the
|
||||
// update prompt to behave like a normal window. Otherwise if the window were hidden
|
||||
// there may be no way for the application to be activated to make it visible again.
|
||||
if ([SUApplicationInfo isBackgroundApplication:[NSApplication sharedApplication]]) {
|
||||
[self.activeUpdateAlert.window setHidesOnDeactivate:NO];
|
||||
[NSApp activateIgnoringOtherApps:YES];
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user