Skip to content

CEF updates taskbar shortcuts if started with empty root cache #3977

@mterrisse

Description

@mterrisse

Windows 11 24H2, CEF 138.0.33 (Chromium 138.0.7204.169)

We have some problems with our applications when they are pinned to the Windows task bar: after a delay all the applications are pinned together as if they share the same AppUserModelID (this is not the case).
And indeed, all the shortcuts have been removed except one and its AppUserModelID has been updated and changed to something like Chromium.EPB4AOK64JIQI5GE5WTFIYKMYI.

I discovered that this is because each time we start a new application we use a new empty root cache.
The Chromium code that causes this issue is MigratePinnedTaskBarShortcutsIfNeeded in chrome\browser\chrome_browser_main_win.cc
It gets browser.shortcut_migration_version from local state (prefs::kShortcutMigrationVersion, chrome\common\pref_names.h) and create a task to change AppUserModelID of shortcuts in the taskbar if

  • the version is invalid
  • or the version is lower than version 86.0.4231.0

So, this code was written to fix problem with versions before 86.0.4231.0.
I went to the conclusion that when the root cache is empty, the version is not valid yet when this code is executed.
Probably the test could be changed to

  • the version is valid
  • and the version is lower than version 86.0.4231.0

Work around:
When we create an empty root cache and before CEF initialization we can add the file "Local State" that contains "browser":{"shortcut_migration_version":"138.0.7204.169",...
This fixes the problem.

Way to reproduce it with cefclient.exe

  • Create two empty folders like C:\Temp\root1 and C:\Temp\root2
  • run cefclient.exe --cache-path=C:\Temp\root1
  • pin it to taskbar and close it
  • look at the shortcut that has been create "Chromium Embedded Framework (CEF) Client Application.lnk", it contains no AppUserModelID (cefclient.exe doesn't specify one)
  • run cefclient.exe --cache-path=C:\Temp\root2
  • After a moment (min: a few seconds, max: two minutes) the shortcut is updated and there is a AppUserModelID like Chromium.EPB4AOK64JIQI5GE5WTFIYKMYI

This should not happen because the version of Chromium is 138.0.7204.169, greater than 86.0.4231.0
If you do the same with C:\Temp\root2 empty except the file "Local State" copied from C:\Temp\root1, this doesn't happen.

Regards,

Michel Terrisse

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugBug reportwindowsWindows platform

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions