Back up all data before proceeding.
Step 1
In the Finder, hold down the option key and select
Go ▹ Library
from the menu bar. From the Library folder, move the following item to the Trash, if it exists:
Application Support/Dock
and move the following items to the Desktop (again, some may not exist):
Preferences/ByHost/com.apple.dock.*.plist
Preferences/com.apple.dock.db
Preferences/com.apple.dock.plist
Here, * stands for a long string of letters and numbers.
Log out or restart the computer and test. If you still have the issue, put the items on the Desktop back where they came from and go to Step 2. Otherwise, delete the items.
Step 2
Restart the computer in safe mode. Certain caches maintained by the system will be rebuilt.
Safe mode is much slower to start up than normal.
When the login screen appears, restart as usual (not in safe mode) and test. There's no need to log in while in safe mode.
Note: If FileVault is enabled in OS X 10.9 or earlier, or if a firmware password is set, or if the startup volume is a Fusion Drive or a software RAID, you can’t start in safe mode. In that case, ask for instructions.