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

Group
 
 

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

Submitter:  Gregory John Casamento <gcasa>
Submitted:  Mon 24 Aug 2009 12:17:30 AM UTC
   
 
Category:  Gui/AppKit Severity:  3 - Normal
Item Group:  Bug Status:  Ready For Test
Privacy:  Public Assigned to:  FredKiefer
Open/Closed:  In Test
* Mandatory Fields

Add a New Comment Rich Markup
   

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>
Group Member
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>
Group Member
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>
Group Member
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>
Group Member
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>
Group administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2009-12-05 FredKiefer StatusNone Ready For Test
        Assigned toNone FredKiefer
        Open/ClosedOpen In Test

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code