On my Mac (Book Pro '19, macOS 13.2.1), when adding and removing apps on the Dock, the system waits ~4 seconds to write this to the ~/Library file, or until the Dock is killed - whichever is fastest. As a result, unexpected behaviour can occur if the user changes Dock presets a few seconds after making changes to the Dock, leading to the loss of a Dock configuration.
Let's say that the user is on preset X (configuration v1) and removes an app (configuration v2), then changes to preset Y. What then happens is:
- the
~/Library Dock file is still in the configuration of preset X v1, so this configuration is copied to /Docks/X
- preset Y is copied from
/Docks/Y to the ~/Library
- the Dock process is killed
- the system only now updates the
~/Library Dock file with the preset X v2 configuration
- the Dock process restarts
- the preset X v2 configuration is shown
Currently, preset Y is still stored in /Docks/Y, even if it isn't visible. However, if the user now changes back from preset Y to preset X:
- the
~/Library Dock file (in the configuration of preset X v2) is copied to /Docks/Y
- preset X (v1) is copied from
/Docks/X to the ~/Library
- Dock is killed, restarts, and preset X v1 configuration is shown
Consequently preset X now represents configuration X v1, and preset Y represents configuration X v2. Configuration Y is lost. I used Finder and Activity Monitor to validate the (order of) steps above.
The above doesn't just happen when the user changes presets; it can also happen when the user quits the app, because that also triggers a change to the "Normal" Dock.
There's 2 workaround options for users:
- wait 5 seconds after making changes to the Dock, before changing presets
- "change" to your currently active preset before changing to the preset you want to activate
This software is super handy, so I hope you or someone else here figures out a solution for this issue (having the code wait 5 seconds before executing the switchScene() function is not a great solution).
On my Mac (Book Pro '19, macOS 13.2.1), when adding and removing apps on the Dock, the system waits ~4 seconds to write this to the ~/Library file, or until the Dock is killed - whichever is fastest. As a result, unexpected behaviour can occur if the user changes Dock presets a few seconds after making changes to the Dock, leading to the loss of a Dock configuration.
Let's say that the user is on preset X (configuration v1) and removes an app (configuration v2), then changes to preset Y. What then happens is:
~/LibraryDock file is still in the configuration of preset X v1, so this configuration is copied to/Docks/X/Docks/Yto the~/Library~/LibraryDock file with the preset X v2 configurationCurrently, preset Y is still stored in
/Docks/Y, even if it isn't visible. However, if the user now changes back from preset Y to preset X:~/LibraryDock file (in the configuration of preset X v2) is copied to/Docks/Y/Docks/Xto the~/LibraryConsequently preset X now represents configuration X v1, and preset Y represents configuration X v2. Configuration Y is lost. I used Finder and Activity Monitor to validate the (order of) steps above.
The above doesn't just happen when the user changes presets; it can also happen when the user quits the app, because that also triggers a change to the "Normal" Dock.
There's 2 workaround options for users:
This software is super handy, so I hope you or someone else here figures out a solution for this issue (having the code wait 5 seconds before executing the
switchScene()function is not a great solution).