mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-22 13:10:59 +00:00
Do not activate application on first run of -activateIgnoringOtherApps:
if commandline argument -autolaunch YES
was specified.
This commit is contained in:
parent
c0e4a4286c
commit
2071f6acdd
2 changed files with 24 additions and 0 deletions
|
@ -1,3 +1,9 @@
|
|||
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:
|
||||
|
|
|
@ -1259,6 +1259,24 @@ 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:`. */
|
||||
NSLog(@"autolaunch = %@", autolaunch);
|
||||
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)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue