LaunchAgent suddenly appears in Dock bouncing when CGImageSourceCopyPropertiesAtIndex is called
Hi all, I've got a launch agent working and communicating with it using a terminal command nicely. I'm using NSXPCConnection classes. If I call CGImageSourceCopyPropertiesAtIndex within the launchagent then the launchagent appears in the dock bouncing. Calling CGImageSourceCopyProperties doesn't cause the same issue. I have tried adding to the LaunchAgent's bundle plist the key LSUIElement with a value of YES. This doesn't change the behaviour. The LaunchAgent continues to work properly and the dictionary obtained from calling CGImageSourceCopyPropertiesAtIndex is saved to disk which is what I wanted to happen. I'm linking against frameworks Foundation and ImageIO. Any thoughts as to why? Kevin
I've got a launch agent working and communicating with it using a terminal command nicely. I'm using NSXPCConnection classes.
If I call CGImageSourceCopyPropertiesAtIndex within the launchagent then the launchagent appears in the dock bouncing. Calling CGImageSourceCopyProperties doesn't cause the same issue. I have tried adding to the LaunchAgent's bundle plist the key LSUIElement with a value of YES. This doesn't change the behaviour. The LaunchAgent continues to work properly and the dictionary obtained from calling CGImageSourceCopyPropertiesAtIndex is saved to disk which is what I wanted to happen.
I'm linking against frameworks Foundation and ImageIO.
Any thoughts as to why?
Some more info. How do I stop the LaunchAgent appearing in the dock? After calling CGImageSourceCopyPropertiesAtIndex the LaunchAgent has opened the profile: /System/Library/ColorSync/Profiles/sRGB Profile.icc The LaunchAgent has also loaded the CoreGraphics framework which wasn't loaded prior to calling CGImageSourceCopyPropertiesAtIndex. I'm thinking they might have something to do with why the LaunchAgent suddenly appears in the dock. For further info I'm including my plist file for the LaunchAgent which lives in ~/Library/LaunchAgents/ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>MachServices</key> <dict> <key>U6TV63RN87.com.yvs.MovieMakerAgent</key> <true/> </dict> <key>Label</key> <string>U6TV63RN87.com.yvs.MovieMakerAgent</string> <key>KeepAlive</key> <false/> <key>ProcessType</key> <string>Adaptive</string> <key>LimitLoadToSessionType</key> <string>Aqua</string> <key>ProgramArguments</key> <array> <string>/Users/ktam/GitHub/MovieMaker/DerivedData/MovieMaker/Build/Products/Debug/U6TV63RN87.com.yvs.MovieMakerAgent.app/Contents/MacOS/U6TV63RN87.com.yvs.MovieMakerAgent</string> </array> </dict> </plist>
On 2013 Aug 12, at 10:28, Kevin Meaney <ktam@yvs.eu.com> wrote:
Some more info. How do I stop the LaunchAgent appearing in the dock?
That's a better question than your first question. Why does your LaunchAgent appear in the Dock to begin with? An even better question might be: Are you sure this is your LaunchAgent which is "appearing" in the Dock? Does your LaunchAgent have an icon? That would be weird. It looks like your LaunchAgent is packaged inside an app…
<key>ProgramArguments</key> <array><string>/Users/ktam/GitHub/MovieMaker/DerivedData/MovieMaker/Build/Products/Debug/U6TV63RN87.com.yvs.MovieMakerAgent.app/Contents/MacOS/U6TV63RN87.com.yvs.MovieMakerAgent</string></array> </dict>
Is it, more precisely, the enclosing *app* whose icon is appearing and bouncing in the dock?
On 12 Aug 2013, at 18:46, Jerry Krinock <jerry@ieee.org> wrote:
Some more info. How do I stop the LaunchAgent appearing in the dock? That's a better question than your first question. Why does your LaunchAgent appear in the Dock to begin with? An even better question might be: Are you sure this is your LaunchAgent which is "appearing" in the Dock? Does your LaunchAgent have an icon? That would be weird.
It is the default application icon that appears in the dock. When I hover the mouse over it, the name is that of my LaunchAgent.
It looks like your LaunchAgent is packaged inside an app…
<key>ProgramArguments</key> <array><string>/Users/ktam/GitHub/MovieMaker/DerivedData/MovieMaker/Build/Products/Debug/U6TV63RN87.com.yvs.MovieMakerAgent.app/Contents/MacOS/U6TV63RN87.com.yvs.MovieMakerAgent</string></array> </dict>
Is it, more precisely, the enclosing *app* whose icon is appearing and bouncing in the dock?
The LaunchAgent is its own application bundle. From reading of the documentation this seemed to be a recommended approach. Though my LaunchAgent uses xpc for communicating it is not an xpc service for a specific application so it shouldn't be a bundle with an extension of xpc and be required to live inside the application bundle. Kevin
On 12 Aug 2013, at 18:58, Kevin Meaney <ktam@yvs.eu.com> wrote:
The LaunchAgent is its own application bundle.
Bouncing in the dock just means that the process has connected to the window server. The window server expects such processes to start an event loop and process events, and that's what stops the bouncing. OTOH, not doing that is fine; the window server won't be too disappointed (-: To prevent the agent showing up in the dock, just set LSBackgroundOnly in your agent's Info.plist. <http://developer.apple.com/library/mac/documentation/general/Reference/InfoPlistKeyReference/Articles/LaunchServicesKeys.html> Share and Enjoy -- Quinn "The Eskimo!" <http://www.apple.com/developer/> Apple Developer Relations, Developer Technical Support, Core OS/Hardware
Thanks for the reply. I thought that it connecting to the window server might be the problem. I've tried both the LSUIElement and LSBackgroundOnly in my agent's plist. I assumed the plist for the launch agent app bundle not the plist that is placed in ~/Library/LaunchAgents. I've tried deleting the launch agent bundle multiple times, rebuilding the launch services registry and multiple restarts in a belief that this setting has been cached and hoped that doing one of these will get the setting LSBackgroundOnly to take. So far without success. Kevin Sent from my iPhone On 13 Aug 2013, at 13:11, "Quinn \"The Eskimo!\"" <eskimo1@apple.com> wrote:
On 12 Aug 2013, at 18:58, Kevin Meaney <ktam@yvs.eu.com> wrote:
The LaunchAgent is its own application bundle.
Bouncing in the dock just means that the process has connected to the window server. The window server expects such processes to start an event loop and process events, and that's what stops the bouncing. OTOH, not doing that is fine; the window server won't be too disappointed (-:
To prevent the agent showing up in the dock, just set LSBackgroundOnly in your agent's Info.plist.
Share and Enjoy -- Quinn "The Eskimo!" <http://www.apple.com/developer/> Apple Developer Relations, Developer Technical Support, Core OS/Hardware
_______________________________________________ launchd-dev mailing list launchd-dev@lists.macosforge.org https://lists.macosforge.org/mailman/listinfo/launchd-dev
Programmer error. I was editing the wrong plist file. My bad. It is working as desired. Sorry for the noise. Kevin Sent from my iPhone On 13 Aug 2013, at 13:51, Kevin Meaney <ktam@yvs.eu.com> wrote:
Thanks for the reply. I thought that it connecting to the window server might be the problem. I've tried both the LSUIElement and LSBackgroundOnly in my agent's plist. I assumed the plist for the launch agent app bundle not the plist that is placed in ~/Library/LaunchAgents.
I've tried deleting the launch agent bundle multiple times, rebuilding the launch services registry and multiple restarts in a belief that this setting has been cached and hoped that doing one of these will get the setting LSBackgroundOnly to take. So far without success.
Kevin
Sent from my iPhone
On 13 Aug 2013, at 13:11, "Quinn \"The Eskimo!\"" <eskimo1@apple.com> wrote:
On 12 Aug 2013, at 18:58, Kevin Meaney <ktam@yvs.eu.com> wrote:
The LaunchAgent is its own application bundle.
Bouncing in the dock just means that the process has connected to the window server. The window server expects such processes to start an event loop and process events, and that's what stops the bouncing. OTOH, not doing that is fine; the window server won't be too disappointed (-:
To prevent the agent showing up in the dock, just set LSBackgroundOnly in your agent's Info.plist.
Share and Enjoy -- Quinn "The Eskimo!" <http://www.apple.com/developer/> Apple Developer Relations, Developer Technical Support, Core OS/Hardware
_______________________________________________ launchd-dev mailing list launchd-dev@lists.macosforge.org https://lists.macosforge.org/mailman/listinfo/launchd-dev
_______________________________________________ launchd-dev mailing list launchd-dev@lists.macosforge.org https://lists.macosforge.org/mailman/listinfo/launchd-dev
participants (3)
-
Jerry Krinock
-
Kevin Meaney
-
Quinn "The Eskimo!"