This commit is contained in:
Sergii Stoian 2019-04-03 01:30:02 +03:00
commit 215eb89e27
3 changed files with 30 additions and 1 deletions

View file

@ -1,3 +1,15 @@
2019-04-02 Sergii Stoian <stoyan255@gmail.com>
* Source/NSApplication.m:
(activateIgnoringOtherApps:) Do not activate application on first run
if commandline argument `-autolaunch YES` was specified.
2019-03-27 Sergii Stoian <stoyan255@gmail.com>
* Headers/AppKit/NSWindow.h:
Lowering down NSFloatingWindowLevel number by one to distinguish
floating panels from menus.
2019-02-26 Fred Kiefer <FredKiefer@gmx.de>
* Source/NSBitmapImageRep+ICNS.m (_imageRepsWithICNSData:): Try to

View file

@ -76,7 +76,7 @@
enum {
NSDesktopWindowLevel = -1000, /* GNUstep addition */ // 2
NSNormalWindowLevel = 0, // 3
NSFloatingWindowLevel = 3, // 4
NSFloatingWindowLevel = 2, // 4
NSSubmenuWindowLevel = 3, // 5
NSTornOffMenuWindowLevel = 3, // 5
NSMainMenuWindowLevel = 20, // 7

View file

@ -1259,6 +1259,23 @@ static NSSize scaledIconSizeForSize(NSSize imageSize)
*/
- (void) activateIgnoringOtherApps: (BOOL)flag
{
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
NSString *autolaunch = [defaults objectForKey: @"autolaunch"];
/* Application was executed with argument '-autolaunch YES'. Set argument
* value to "NO" for future calls to `activateIgnoringOtherApps:`. */
if (autolaunch && [autolaunch isEqualToString: @"YES"])
{
NSMutableDictionary *args;
args = [[defaults volatileDomainForName: NSArgumentDomain] mutableCopy];
[defaults removeVolatileDomainForName: NSArgumentDomain];
[args setObject: @"NO" forKey: @"autolaunch"];
[defaults setVolatileDomain: [NSDictionary dictionaryWithDictionary: args]
forName: NSArgumentDomain];
[args release];
return;
}
// TODO: Currently the flag is ignored
if (_app_is_active == NO)
{