From 62fef26ef8c9fb7ecf5fbc37b85004f04a9cb8a3 Mon Sep 17 00:00:00 2001 From: Felarof Date: Tue, 2 Dec 2025 13:48:36 -0800 Subject: [PATCH] fix(windows): warning icon when pinned on taskbar on windows Two separate Windows-specific fixes: 1. Taskbar Warning Icon Fix: - Issue: Yellow warning triangle on pinned taskbar icon - Root cause: BrowserWindowPropertyManager::UpdateWindowProperties() sets PKEY_AppUserModel_RelaunchCommand/RelaunchIconResource only when shortcut_manager is non-null AND kProfileIconVersion pref exists. If either condition fails, relaunch properties are empty, causing Windows to show a warning overlay due to app identity mismatch. - Fix: Added fallback else branch that uses exe path directly as icon source and relaunch command. Ensures relaunch properties are never empty for normal browser windows. 2. VisualElements Branding Fix: - Issue: Start Menu tiles referenced chrome.VisualElementsManifest.xml - Fix: Created browseros.VisualElementsManifest.xml and updated BUILD.gn to reference it. --- .../chromium_patches/chrome/BUILD.gn | 11 +++++- .../browseros.VisualElementsManifest.xml | 16 ++++++++ .../browser_window_property_manager_win.cc | 37 +++++++++++++++++++ 3 files changed, 63 insertions(+), 1 deletion(-) create mode 100644 packages/browseros/chromium_patches/chrome/app/visual_elements_resources/browseros.VisualElementsManifest.xml create mode 100644 packages/browseros/chromium_patches/chrome/browser/ui/views/frame/browser_window_property_manager_win.cc diff --git a/packages/browseros/chromium_patches/chrome/BUILD.gn b/packages/browseros/chromium_patches/chrome/BUILD.gn index d462eacd6..5e039c74b 100644 --- a/packages/browseros/chromium_patches/chrome/BUILD.gn +++ b/packages/browseros/chromium_patches/chrome/BUILD.gn @@ -1,5 +1,5 @@ diff --git a/chrome/BUILD.gn b/chrome/BUILD.gn -index 97f843f8133c4..0acbe29f11806 100644 +index 97f843f8133c4..7846f837e754d 100644 --- a/chrome/BUILD.gn +++ b/chrome/BUILD.gn @@ -18,6 +18,7 @@ import("//build/config/win/manifest.gni") @@ -37,3 +37,12 @@ index 97f843f8133c4..0acbe29f11806 100644 configs += [ ":chrome_dll_symbol_order" ] if (!is_component_build && !using_sanitizer) { configs += [ ":chrome_dll_symbol_exports" ] +@@ -1492,7 +1499,7 @@ copy("visual_elements_resources") { + sources = [ + "//chrome/app/theme/$branding_path_component/win/tiles/Logo.png", + "//chrome/app/theme/$branding_path_component/win/tiles/SmallLogo.png", +- "app/visual_elements_resources/chrome.VisualElementsManifest.xml", ++ "app/visual_elements_resources/browseros.VisualElementsManifest.xml", + ] + + if (is_chrome_branded) { diff --git a/packages/browseros/chromium_patches/chrome/app/visual_elements_resources/browseros.VisualElementsManifest.xml b/packages/browseros/chromium_patches/chrome/app/visual_elements_resources/browseros.VisualElementsManifest.xml new file mode 100644 index 000000000..ae89c0968 --- /dev/null +++ b/packages/browseros/chromium_patches/chrome/app/visual_elements_resources/browseros.VisualElementsManifest.xml @@ -0,0 +1,16 @@ +diff --git a/chrome/app/visual_elements_resources/browseros.VisualElementsManifest.xml b/chrome/app/visual_elements_resources/browseros.VisualElementsManifest.xml +new file mode 100644 +index 0000000000000..a7bb10b4056e2 +--- /dev/null ++++ b/chrome/app/visual_elements_resources/browseros.VisualElementsManifest.xml +@@ -0,0 +1,10 @@ ++ ++ ++ ++ diff --git a/packages/browseros/chromium_patches/chrome/browser/ui/views/frame/browser_window_property_manager_win.cc b/packages/browseros/chromium_patches/chrome/browser/ui/views/frame/browser_window_property_manager_win.cc new file mode 100644 index 000000000..a2e7a25cd --- /dev/null +++ b/packages/browseros/chromium_patches/chrome/browser/ui/views/frame/browser_window_property_manager_win.cc @@ -0,0 +1,37 @@ +diff --git a/chrome/browser/ui/views/frame/browser_window_property_manager_win.cc b/chrome/browser/ui/views/frame/browser_window_property_manager_win.cc +index 1a62480aee22c..2b678add30238 100644 +--- a/chrome/browser/ui/views/frame/browser_window_property_manager_win.cc ++++ b/chrome/browser/ui/views/frame/browser_window_property_manager_win.cc +@@ -6,6 +6,7 @@ + + #include "base/command_line.h" + #include "base/functional/bind.h" ++#include "base/path_service.h" + #include "base/strings/utf_string_conversions.h" + #include "base/win/windows_version.h" + #include "chrome/browser/browser_process.h" +@@ -17,6 +18,7 @@ + #include "chrome/browser/web_applications/extensions/web_app_extension_shortcut.h" + #include "chrome/browser/web_applications/web_app_helpers.h" + #include "chrome/common/pref_names.h" ++#include "chrome/installer/util/install_util.h" + #include "components/prefs/pref_service.h" + #include "extensions/browser/extension_registry.h" + #include "ui/base/win/shell.h" +@@ -87,6 +89,16 @@ void BrowserWindowPropertyManager::UpdateWindowProperties() { + shortcut_manager->GetShortcutProperties(profile->GetPath(), &command_line, + &pinned_name, &icon_path); + command_line_string = command_line.GetCommandLineString(); ++ } else if (browser->is_type_normal() || browser->is_type_popup()) { ++ // Fallback: Set basic relaunch details using the current executable. ++ // This ensures taskbar pinning works correctly even when the profile ++ // icon hasn't been created yet (e.g., in developer builds). ++ base::FilePath exe_path; ++ if (base::PathService::Get(base::FILE_EXE, &exe_path)) { ++ icon_path = exe_path; ++ command_line_string = L"\"" + exe_path.value() + L"\""; ++ pinned_name = InstallUtil::GetDisplayName(); ++ } + } + ui::win::SetAppDetailsForWindow(app_id, icon_path, 0, command_line_string, + pinned_name, hwnd_);