Difference between revisions of "Hiding a macOS app from the Dock"

From Lazarus wiki
Jump to navigationJump to search
m (→‎Hiding a macOS app from the Dock: Fixed duped heading :-)
m (Rationalised macOS categories)
Line 1: Line 1:
 +
{{LanguageBar}}
 +
 
There is no way to hide an application from the Dock at run-time, but the application can declare itself to be an ''agent''. macOS doesn't show agents in the Dock or in the Force Quit Applications window.  ''Agents'' are visible for utilities like ''Activity Monitor'', Unix command-line tools (eg top), as well as macOS API functions.
 
There is no way to hide an application from the Dock at run-time, but the application can declare itself to be an ''agent''. macOS doesn't show agents in the Dock or in the Force Quit Applications window.  ''Agents'' are visible for utilities like ''Activity Monitor'', Unix command-line tools (eg top), as well as macOS API functions.
  
{{Warning| Agents are never shown in application's menu. So the agent application should provide StatusBar (TTrayIcon) user interface, hotkeys so they can be switched off, or should be launched/terminated by another GUI application. }}
+
{{Warning| Agents are never shown in application's menu. So the agent application should provide a StatusBar (TTrayIcon) user interface, hotkeys so they can be switched off, or should be launched/terminated by another GUI application. }}
  
 
For example, startlazarus is an ''agent'', launched by the Lazarus IDE when rebuilt.  
 
For example, startlazarus is an ''agent'', launched by the Lazarus IDE when rebuilt.  
Line 13: Line 15:
 
[[Image:infoplistinside.png]]
 
[[Image:infoplistinside.png]]
  
[[Category:Mac OS X]]
 
 
[[Category:macOS]]
 
[[Category:macOS]]
 
[[Category:Platform-sensitive development]]
 
[[Category:Platform-sensitive development]]

Revision as of 02:04, 14 December 2019

English (en)

There is no way to hide an application from the Dock at run-time, but the application can declare itself to be an agent. macOS doesn't show agents in the Dock or in the Force Quit Applications window. Agents are visible for utilities like Activity Monitor, Unix command-line tools (eg top), as well as macOS API functions.

Warning-icon.png

Warning: Agents are never shown in application's menu. So the agent application should provide a StatusBar (TTrayIcon) user interface, hotkeys so they can be switched off, or should be launched/terminated by another GUI application.

For example, startlazarus is an agent, launched by the Lazarus IDE when rebuilt.

To declare an application to be an agent, open the application's bundle Info.plist file:

  • add a property LSUIElement (or "Application is agent");
  • set LSUIElement property's value to True (or check with the checkbox);
  • save the Info.plist file.

infoplistinside.png