CNET también está disponible en español.

Ir a español

Don't show this again

HolidayBuyer's Guide
Computers

"Locked" Dock problems and hidden Dock settings

Occasionally, the Dock in OS X stops behaving properly; either you are not able to put items on the Dock, the Dock doesn't display open applications, or you are not able to remove items on the Dock.

Occasionally, the Dock in OS X stops behaving properly; either you are not able to put items on the Dock, the Dock doesn't display open applications, or you are not able to remove items on the Dock.

Apple Discussion Poster "The.Yoder:
"Just recently installed Leopard on a bigger HD, and migrated all my information over. When I try to add an application to the dock or move apps in the dock it won't let me. IS it possible that the dock is locked?"

These problems are usually because the Dock's preferences file has been corrupted, which can happen during system upgrades, account migration, or even from using some poorly written programs. In some cases, people have found Dock problems to be hardware-related, where certain input devices seem to invoke the single-click contextual menu faster than usual. This makes it very hard to move items before the menu prevents it. However, these instances, which likely are from driver issues, have not been common, and most Dock problems are related to the preferences files.

Like most other OS X applications, the Dock has its own preferences file for storing account-specific settings. Corruption in this file can prevent it from being edited with information about newly added applications, leading to the problematic behaviors displayed by affected Docks. When problems with the Dock occur, removing the preferences file should help.

Beyond corruption and preference-file inaccessibility, there are some hidden settings for the Dock that can intentionally cause it to behave in these ways. These settings disable the Dock from accepting new items and allowing current items to be removed. If these settings are enabled, the Dock will not behave as it normally does. If these settings were responsible for the strange behavior, however, you would probably have had to enable them manually beforehand. Still, even if you have not manually altered your Dock's preferences file, we will take a look at these commands, since they may be useful beyond the scope of this problem.

While in most cases we recommend you remove the Dock's preferences and set it back up from the default settings, these hidden settings may be useful for further customizing how the Dock treats applications.

Fix:

1. Remove the Dock's preferences

If you're experiencing problems with the Dock, first remove the file called "com.apple.Dock.plist," which is located in the /username/Library/Preferences/ folder. Then either restart or logout and log back in to relaunch the Dock. In addition, you may also need to remove the "com.apple.Dock.db" file that's in the same location as the Dock's preferences.

After this is done the Dock will need to be set up again, but should behave normally.

Useful Hidden Settings:

1. Prevent all items in the dock from being removed.

The following command is commonly used to essentially lock the Dock and prevent items from being added or removed. Copying and pasting this command into the terminal should lock the Dock.

defaults write com.apple.dock contents-immutable -bool true; killall Dock

To reverse this command, enter it again using "false" instead of "true" in the command.

2. Lock only certain items in the Dock.

A potentially more useful alternative to locking the entire Dock is to only lock certain items in it, leaving others able to be added and removed. In order to do this, you will need to set up the Dock using the following steps:

  • First, place only the applications in the Dock that you want to be static, removing all others (items to the right of the separator bar don't matter). For instance, if you want Safari to be static, remove all applications except for Safari.
  • Use TextEdit or another text editor to open the Dock's preferences file (in the location noted above).
  • Find the array called "persistent-apps", which should have sections labeled "dict" that each contain the information for a single application in the Dock (ie: Safari).
  • Change the "persistent-apps" label to "static-apps", and then save and close the preferences file.
  • Log out and log back in (or restart) to relaunch the Dock.

After these steps are done, newly added applications will be removable, but the previously added ones will be stuck in the dock and not removable; however, you will still be able to organize them as you wish.

NOTE: This can also be done with the nonapplication items to the right of the separator bar, such as Stacks. To do this, follow the same procedure with the items to the right of the separator bar, ignoring the applications. Then, instead of changing the "persistent-apps" label, locate and change the "persistent-others" label to "static-others."

Resources
  • The.Yoder
  • More from Late-Breakers