Skip to content

Recent Dock changes lead to unexpected behavior #9

Description

@basoppenheim

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:

  1. the ~/Library Dock file is still in the configuration of preset X v1, so this configuration is copied to /Docks/X
  2. preset Y is copied from /Docks/Y to the ~/Library
  3. the Dock process is killed
  4. the system only now updates the ~/Library Dock file with the preset X v2 configuration
  5. the Dock process restarts
  6. 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:

  1. the ~/Library Dock file (in the configuration of preset X v2) is copied to /Docks/Y
  2. preset X (v1) is copied from /Docks/X to the ~/Library
  3. 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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions