LSUIElement and LSBackgroundOnly

  • My application's icon should be hidden from the Dock.

    The first version of my software had LSUIElement set in it's
    Info.plist but the Icon still appeared on some systems (I received
    bug reports).

    The current version, has both keys, LSUIElement and LSBackgroundOnly
    set:

        <key>LSBackgroundOnly</key>
        <string>1</string>
        <key>LSUIElement</key>
        <string>1</string>

    However, I'm getting curious feedback. Some say it finally works now
    but others report that the Dock icon appears since they have upgraded
    to the new version and everything was fine before.

    All users are running Mac OS X 10.4.x.

    What am I doing wrong? Any help would be appreciated.

    Stefan
  • I believe that you can't have an application which is simultaneously a
    UIElement app and a Background only app.  Please check the
    documentation on these flags.  :-)

    On Jul 13, 2005, at 2:31 AM, Stefan Schüßler wrote:

    > My application's icon should be hidden from the Dock.
    >
    > The first version of my software had LSUIElement set in it's
    > Info.plist but the Icon still appeared on some systems (I received bug
    > reports).
    >
    > The current version, has both keys, LSUIElement and LSBackgroundOnly
    > set:
    >
    > <key>LSBackgroundOnly</key>
    > <string>1</string>
    > <key>LSUIElement</key>
    > <string>1</string>
    >
    > However, I'm getting curious feedback. Some say it finally works now
    > but others report that the Dock icon appears since they have upgraded
    > to the new version and everything was fine before.
    >
    > All users are running Mac OS X 10.4.x.
    >
    > What am I doing wrong? Any help would be appreciated.
    >
    > Stefan
    >
    > _______________________________________________
    > Do not post admin requests to the list. They will be ignored.
    > Cocoa-dev mailing list      (<Cocoa-dev...>)
    > Help/Unsubscribe/Update your Subscription:
    > http://lists.apple.com/mailman/options/cocoa-dev/<ctj951...>
    >
    > This email sent to <ctj951...>
    >
  • I couldn't find anything about incompatibility in the docs.

    However, how do I keep the Dock from showing my application's Icon if
    LSUIElement is not working?

    Stefan

    On 13.07.2005, at 10:48, Chad Jones wrote:

    > I believe that you can't have an application which is
    > simultaneously a UIElement app and a Background only app.  Please
    > check the documentation on these flags.  :-)
    >
    > On Jul 13, 2005, at 2:31 AM, Stefan Schüßler wrote:
    >
    >> My application's icon should be hidden from the Dock.
    >>
    >> The first version of my software had LSUIElement set in it's
    >> Info.plist but the Icon still appeared on some systems (I received
    >> bug reports).
    >>
    >> The current version, has both keys, LSUIElement and
    >> LSBackgroundOnly set:
    >>
    >> <key>LSBackgroundOnly</key>
    >> <string>1</string>
    >> <key>LSUIElement</key>
    >> <string>1</string>
    >>
    >> However, I'm getting curious feedback. Some say it finally works
    >> now but others report that the Dock icon appears since they have
    >> upgraded to the new version and everything was fine before.
    >>
    >> All users are running Mac OS X 10.4.x.
    >>
    >> What am I doing wrong? Any help would be appreciated.
    >>
    >> Stefan
  • I've just took a look at the floating clock (/System/Library/
    CoreServices/Menu Extras/Clock.menu/Contents/Resources/WindowClock.app).

    It has different keys:

        <key>NSUIElement</key>
        <string>1</string>
        <key>zLSUIElement</key>
        <string>1</string>

    Does this make any sense to anyone?

    Are we supposed to use deprecated (NSUIElement) and undocumented
    (zLSUIElement) keys?

    Stefan

    On 13.07.2005, at 11:37, Wincent Colaiuta wrote:

    > *Some* of my users are reporting the same problems:
    >
    > http://wincent.com/a/support/bugs/show_bug.cgi?id=192
    >
    > Personally I think this is a bug in Tiger, but nobody seems to be
    > willing to gather the information necessary to figure out a
    > workaround...
    >
    > Best wishes,
    > Wincent
    >
    > El 13/07/2005, a las 10:31, Stefan Schüßler escribió:
    >
    >> My application's icon should be hidden from the Dock.
    >>
    >> The first version of my software had LSUIElement set in it's
    >> Info.plist but the Icon still appeared on some systems (I received
    >> bug reports).
    >>
    >> The current version, has both keys, LSUIElement and
    >> LSBackgroundOnly set:
    >>
    >> <key>LSBackgroundOnly</key>
    >> <string>1</string>
    >> <key>LSUIElement</key>
    >> <string>1</string>
    >>
    >> However, I'm getting curious feedback. Some say it finally works
    >> now but others report that the Dock icon appears since they have
    >> upgraded to the new version and everything was fine before.
    >>
    >> All users are running Mac OS X 10.4.x.
    >>
    >> What am I doing wrong? Any help would be appreciated.
    >>
    >> Stefan
  • On 7/13/05, Stefan Schüßler <stefan...> wrote:
    > I've just took a look at the floating clock (/System/Library/
    > CoreServices/Menu Extras/Clock.menu/Contents/Resources/WindowClock.app).
    >
    > It has different keys:
    >
    > <key>NSUIElement</key>
    > <string>1</string>
    > <key>zLSUIElement</key>
    > <string>1</string>
    >
    > Does this make any sense to anyone?

    No. Looks like a bug.

    -- Finlay
  • On Jul 13, 2005, at 6:57 AM, Finlay Dobbie wrote:

    > On 7/13/05, Stefan Schüßler <stefan...> wrote:
    >
    >> I've just took a look at the floating clock (/System/Library/
    >> CoreServices/Menu Extras/Clock.menu/Contents/Resources/
    >> WindowClock.app).
    >>
    >> It has different keys:
    >>
    >> <key>NSUIElement</key>
    >> <string>1</string>
    >> <key>zLSUIElement</key>
    >> <string>1</string>
    >>
    >> Does this make any sense to anyone?
    >>
    >
    > No. Looks like a bug.
    >

    To me it looks like the "we want to comment out something but are
    doing something that does support comments, or is just easier to not
    use comments, so prefix it with a bogus character like 'x' or 'z' to
    cause this things to be ignored".

    So they originally had LSUIElement, and wanted to disable it, so
    rather than delete the entry and replace it if it wasn't the right
    approach, they prepended the 'z'.

    Glenn Andreas                      <gandreas...>
      <http://www.gandreas.com/> wicked fun!
    quadrium | build, mutate, evolve | images, textures, backgrounds, art
  • On 13.07.2005, at 14:58, glenn andreas wrote:

    > So they originally had LSUIElement, and wanted to disable it, so
    > rather than delete the entry and replace it if it wasn't the right
    > approach, they prepended the 'z'.

    Nonetheless NSUIElement isn't documented anymore. If LSUIElement is
    buggy there should be a note somewhere.

    Stefan
  • On 7/13/05, Stefan Schüßler <stefan...> wrote:
    > On 13.07.2005, at 14:58, glenn andreas wrote:
    >
    >> So they originally had LSUIElement, and wanted to disable it, so
    >> rather than delete the entry and replace it if it wasn't the right
    >> approach, they prepended the 'z'.
    >
    > Nonetheless NSUIElement isn't documented anymore. If LSUIElement is
    > buggy there should be a note somewhere.

    I've never seen or heard of issues with LSUIElement, FWIW.

    -- Finlay
  • On Jul 13, 2005, at 03:17 AM, Stefan Schüßler wrote:

    > However, how do I keep the Dock from showing my application's Icon
    > if LSUIElement is not working?

    Every time I've had this problem, it was because of Launch Services
    somehow forgetting that the application is supposed to run in the
    background. Try running the "touch" command on the .app bundle and
    then launch it, and see what happens.

    Nick Zitzmann
    <http://www.chronosnet.com/>
  • Am 13.07.2005 um 15:19 Uhr schrieb Stefan Schüßler:

    > If LSUIElement is buggy there should be a note somewhere.

    I don't think it's buggy. Works just fine for me.

    > but the Icon still appeared on some systems (I received bug reports).

    Are you *sure* the flag was set on these systems? Were you able to
    verify the problem?

    You also should be aware that the OS apparently is caching the plist
    values. At least in 10.3 touching the app bundle helped, but I'm not
    sure if that's still good enough for 10.4 ...

    Andreas _______________________________________________
    Do not post admin requests to the list. They will be ignored.
    Cocoa-dev mailing list      (<Cocoa-dev...>)
    Help/Unsubscribe/Update your Subscription:
    http://lists.apple.com/mailman/options/cocoa-dev/<cocoa...>

    This email sent to <cocoa...>
  • On 13.07.2005, at 15:56, Andreas Mayer wrote:

    > I don't think it's buggy. Works just fine for me.

    It works fine for me, too. But since people filed bug reports there
    seems to be a problem.

    > Are you *sure* the flag was set on these systems? Were you able to
    > verify the problem?

    Well, as long as the plist wasn't changed...

    > You also should be aware that the OS apparently is caching the
    > plist values. At least in 10.3 touching the app bundle helped, but
    > I'm not sure if that's still good enough for 10.4...

    So should I "touch" the application programatically before calling
    launchApplication?

    Stefan
  • Hi again, :-)  [if you are EricS see below!]

    >>> My application's icon should be hidden from the Dock.
    >>>
    >>> The first version of my software had LSUIElement set in it's
    >>> Info.plist but the Icon still appeared on some systems (I received
    >>> bug reports).
    >>>
    >>> The current version, has both keys, LSUIElement and LSBackgroundOnly
    >>> set:
    >>>
    >>> <key>LSBackgroundOnly</key>
    >>> <string>1</string>
    >>> <key>LSUIElement</key>
    >>> <string>1</string>
    >>
    >> On 13.07.2005, at 10:48, Chad Jones wrote:
    >>
    >> I believe that you can't have an application which is simultaneously
    >> a UIElement app and a Background only app.  Please check the
    >> documentation on these flags.  :-)
    >>
    > I couldn't find anything about incompatibility in the docs.
    >
    > However, how do I keep the Dock from showing my application's Icon if
    > LSUIElement is not working?
    >
    > Does this make any sense to anyone?
    >
    > Are we supposed to use deprecated (NSUIElement) and undocumented
    > (zLSUIElement) keys?

    NSUIElement is depreciated.  However, I remember clearly from working
    at Apple (Apple DTS) a few years back that NSUIElement and LSUIElement
    map to the same thing (at least it did back when I was there and I
    doubt that would have changed).  Though NSUIElement is depreciated (NS
    stands for next step of course! and LS stands for launch services),
    they are exactly the same thing for all intents and purposes.  Having
    said that LSUIElement is recommended and LSUIElement is depreciated
    because they want to limit use of the older flag (why I never
    understood that, maybe they just like the LS flags better for
    consistencey).  In any case use LSUIElement (good!) and not NSUIElement
    (bad!).

    > I couldn't find anything about incompatibility in the docs.

    Last night I believed I remembered having a conversation with Eric
    Schlegel back when I was working on the Kiosk stuff (technote TN2062)
    that he said we never had to worry about an application being a
    UIElement and a Background-Only application at the same time.  That's
    why FAQ #5 has the "Important Note:" in that technote.  However, now I
    think I might have been mistaken.  I think what the actual conversation
    was, was that an application should never be a UIElement and a Kiosk
    application at the same time (something like that).  In any case the
    person to ask on this is Eric perhaps he can shed some light.

    Eric do you recall what is the case here can an application be a
    UIElement and simaltanously a background only application?

    Also, as to Stefan's original question he doesn't want his application
    in the Dock but he's having issues with LSUIElement (bug reports?).
    Any ideas on this?

    Thanks Eric sometimes I don't know how you do it (ok MOST/ALL times I
    don't know how you do it!).  OK see ya.  :-)

    Thanks again Eric.
    Chad. :-)

    Original question below:
    >> My application's icon should be hidden from the Dock.
    >>
    >> The first version of my software had LSUIElement set in it's
    >> Info.plist but the Icon still appeared on some systems (I received
    >> bug reports).
    >>
    >> The current version, has both keys, LSUIElement and LSBackgroundOnly
    >> set:
    >>
    >> <key>LSBackgroundOnly</key>
    >> <string>1</string>
    >> <key>LSUIElement</key>
    >> <string>1</string>
    >>
    >> However, I'm getting curious feedback. Some say it finally works now
    >> but others report that the Dock icon appears since they have upgraded
    >> to the new version and everything was fine before.
    >>
    >> All users are running Mac OS X 10.4.x.
    >>
    >> What am I doing wrong? Any help would be appreciated.
    >>
    >> Stefan
  • On Jul 13, 2005, at 11:48 AM, Chad Jones wrote:

    >> I couldn't find anything about incompatibility in the docs.
    >>
    >> However, how do I keep the Dock from showing my application's Icon
    >> if LSUIElement is not working?
    >>
    >> Does this make any sense to anyone?
    >>
    >> Are we supposed to use deprecated (NSUIElement) and undocumented
    >> (zLSUIElement) keys?
    >>
    >
    > NSUIElement is deprecated.  However, I remember clearly from
    > working at Apple (Apple DTS) a few years back that NSUIElement and
    > LSUIElement map to the same thing (at least it did back when I was
    > there and I doubt that would have changed).  Though NSUIElement is
    > depreciated (NS stands for next step of course! and LS stands for
    > launch services), they are exactly the same thing for all intents
    > and purposes.

    That is still correct. The window server (which owns the relevant
    bits of the process management code in this case) checks for both
    NSUIElement and LSUIElement, and if either is set, the app is marked
    as being a UIElement app. Which one you use does not make any
    difference.

    > Last night I believed I remembered having a conversation with Eric
    > Schlegel back when I was working on the Kiosk stuff (technote
    > TN2062) that he said we never had to worry about an application
    > being a UIElement and a Background-Only application at the same time.

    That's also correct, since the window server basically does this:

    if ( app has LSBackgroundOnly or NSBGOnly keys )
        appIsBGOnly = true;
    else if ( app has LSUIElement or NSUIElement keys )
        appIsUIElement = true;

    so you can see that appIsBGOnly and appIsUIElement can't both be true
    at the same time. LSBackgroundOnly or NSBGOnly will override LS/
    NSUIElement.

    > However, now I think I might have been mistaken.  I think what the
    > actual conversation was, was that an application should never be a
    > UIElement and a Kiosk application at the same time (something like
    > that).

    That's also true. The mode set by SetSystemUIMode only applies when
    the app is the active app, and UIElement apps generally aren't
    supposed to become the active app, so using SetSystemUIMode in a
    UIElement app doesn't make any sense.

    > Also, as to Stefan's original question he doesn't want his
    > application in the Dock but he's having issues with LSUIElement
    > (bug reports?).  Any ideas on this?

    No idea. LSUIElement=1 should be enough. If that's not working, it's
    time for a bug report.

    -eric
  • On 13.07.2005, at 22:00, Eric Schlegel wrote:

    > The window server (which owns the relevant bits of the process
    > management code in this case) checks for both NSUIElement and
    > LSUIElement, and if either is set, the app is marked as being a
    > UIElement app. Which one you use does not make any difference.

    > appIsBGOnly and appIsUIElement can't both be true at the same time.
    > LSBackgroundOnly or NSBGOnly will override LS/NSUIElement.

    > LSUIElement=1 should be enough. If that's not working, it's time
    > for a bug report.

    Thank you very much Eric (and thanks Chad for bringing Eric into this
    thread), I wish the documentation was as clear.

    Best,

    Stefan
previous month july 2005 next month
MTWTFSS
        1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31
Go to today