Open Bug 1714148 Opened 3 years ago Updated 3 years ago

Minimized windows reopen when "Keep in Dock"

Categories

(Toolkit :: General, defect, P2)

Unspecified
macOS
defect

Tracking

()

People

(Reporter: Mardak, Unassigned, NeedInfo)

References

(Blocks 1 open bug)

Details

Bug 1709598 added the ability to keep firefox in the dock and bug 1712802 makes use of it from about:welcome

STR:
0. ensure firefox is not already "Keep in Dock" (app dock context menu -> options -> keep in dock)

  1. open a second firefox window
  2. minimize the second window to the dock
  3. go to about:welcome in the first window
  4. click "Keep in Dock"

Expected: minimized window stays minimized
Actual: minimized window becomes visible

Alternatively

Cc["@mozilla.org/widget/macdocksupport;1"].getService(Ci.nsIMacDockSupport).ensureAppIsPinnedToDock()

This is indeed a pretty bad experience, especially because it restores all minimized windows from other applications as well. I'm sure this is because we're currently killing the Dock after pinning the app. :jwatt, can you refresh our memory: what is the experience if we were to not kill the Dock? Is it just that the app icon isn't placed in the correct location on the Dock, for example after any other pinned browsers? If that's the only downside, we may want to avoid killing the Dock since the app will most likely be placed in the right location after a system restart.

Flags: needinfo?(jwatt)
Priority: -- → P2

The changes we make, both the pinning, and the removal of any existing app tile (one running from a read-only .dmg mount) will not take effect until some point in the future. Thinking about it, we should also check that our changes are not wiped out if the user makes some other change to the Dock (such as pinning or moving another tile) in the meantime.

I should note that after I had difficulty figuring out how to get the changes to take effect I took a look to see how Chrome was doing it, and they also kill the Dock. So while this is not great, I guess they're getting away with it, or at least feel it's a necessary tradeoff.

Flags: needinfo?(jwatt)
Flags: needinfo?(jwatt)

I tested this briefly yesterday and I found that adding our icon to the list of of pinned apps in the plist is not enough, at least not in the first run experience. In the first run experience, we install the app to /Applications, we pin the app to the Dock, then shut down the first instance, then restart the app from /Applications and it looks like restarting the app from /Applications causes macOS to remember Firefox as a "most recently run" app now, so it continues to show up there and will never show up where we intended to pin the icon. This is true even if I then go ahead and kill the Dock, restart the system and/or log out and log back in. The fact that the app was most recently in the "most recently run apps" section seems to be what is remembered by the system, and our attempt at pinning the icon is lost.

This means that we still need a way to make macOS remember our pinned icon, either by killing the Dock as we do now or some yet-to-be-determined way.

Hey there :jwatt, gentle reminder to take a look at this bug when you have a chance, thanks!

You need to log in before you can comment on or make changes to this bug.