bugGNUstep - Bugs: bug #27309, Can't start an app hidden....

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #27309: Can't start an app hidden....

Submitted by:  Gregory John Casamento <gcasa>
Submitted on:  Mon 24 Aug 2009 12:17:30 AM UTC  
 
Category: Gui/AppKitSeverity: 3 - Normal
Item Group: BugStatus: Ready For Test
Privacy: PublicAssigned to: Fred Kiefer <FredKiefer>
Open/Closed: In Test

(Jump to the original submission Jump to the original submission)

Sat 05 Dec 2009 11:25:46 PM UTC, comment #6:

Well, it sort of works, but not in a useful way for a machine where the workspace manager doesn't own the appicons (i.e. one using GNUstep).

The program starts, and doesn't create any windows (not even the appicon needed to activate the app). Also, "Got response with postNotificationName:object:userInfo:deliverImmediately:for:" shows up in the logs (doesn't happen without -autolaunch).

Jeff Teunissen <Deek>
Sat 05 Dec 2009 10:50:37 PM UTC, comment #5:

Still hoping for some comments from the original author.

Fred Kiefer <FredKiefer>
Project MemberIn charge of this item.
Sun 08 Nov 2009 05:25:27 PM UTC, comment #4:

I just submitted my proposed change, could you please have a look and report back, whether this helped?

Fred Kiefer <FredKiefer>
Project MemberIn charge of this item.
Sat 12 Sep 2009 04:35:02 PM UTC, comment #3:

Hmm, this sounds to me as if we just should only call activateIgnoringOtherApps: in finishLaunching when the application isn't hidden. What we also need to take care of is to create the application with _app_is_hidden set to NO for this to work. The only difference to the current code will then be that unhideWithoutActivation wont be called when the application starts up, but is this really needed?

Fred Kiefer <FredKiefer>
Project MemberIn charge of this item.
Sat 12 Sep 2009 08:17:29 AM UTC, comment #2:

No, you can't do that. It's totally up to the app what happens when -NXAutoLaunch YES (not -autolaunch) is passed (the lib doesn't even understand it).

The library cannot make this kind of decision, because any and all special actions performed by an application when auto-launched are unique to that app.

On NS/OS, many apps have special behavior when autolaunched: chiefly Preferences, Mail, Terminal, and Edit.

Preferences defers creating its windows and doesn't load its nibs; all it does is start the clock view. Mail does the same (unless you disable the "Hide on Autolaunch" option), except it displays mail status in its icon.

Edit and Terminal use auto-launching as an opportunity to preload their code and set up their services, so when you click on their icons they start up fast (unless, again, you disable the "Hide on Autolaunch" option, in which case they start normally).

All act as reduced-capability versions of themselves. Preferences happens to not have an option for it, as its most-used function is as a combination calendar/clock.

For an app that has decided to treat autolaunching as preloading, the canonical response is for the application to send the shared NSApplication object the -hide: message in -applicationWillFinishLaunching. This prevents any application window from ever reaching the screen, because the Application Kit does not hide and unhide apps behind the scenes.

The point here is not that -NXAutoLaunch doesn't work, but that an app cannot start without putting any windows on the screen unless you bypass their creation entirely.

Jeff Teunissen <Deek>
Mon 24 Aug 2009 07:30:11 PM UTC, comment #1:

This could be resolved by not calling activateIgnoringOtherApps: in [NSApplication finishLaunching] when the parameter "autolaunch" is given. We probably should think a bit more about the pre-conditions, though.

Fred Kiefer <FredKiefer>
Project MemberIn charge of this item.
Mon 24 Aug 2009 12:17:30 AM UTC, original submission:

This issue was reported to me by Deek in IRC.

In Preferences.app, in Backbone the following workaround is in Controller.m:

/*
This should work, but doesn't because GNUstep
starts apps hidden unhides them between
-applicationWillFinishLaunching: and
-applicationDidFinishLaunching:
*/
#if 0
if ([defaults boolForKey: @"autolaunch"]) {
[NSApp hide: self];
}
#endif

Additional comments from IRC...
---
<Deek> On NS/OS, the -NXAutoLaunch argument is sent by WM.app when it auto-launches an app on login.

<Deek> Apps often have a "Hide on Auto-launch" option, which prevents the app from loading its UI or appearing as anything other than its icon.

Gregory John Casamento <gcasa>
Project Administrator

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by Deek (Posted a comment)
  • -unavailable- added by FredKiefer (Posted a comment)
  • -unavailable- added by gcasa (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat 05 Dec 2009 10:50:37 PM UTCFredKieferStatusNone=>Ready For Test
      Assigned toNone=>FredKiefer
      Open/ClosedOpen=>In Test

    Back to the top


    Powered by Savane 3.1-cleanup1