Skip to content

Commit d0a27ab

Browse files
committed
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.
1 parent 95b97f9 commit d0a27ab

File tree

3 files changed

+63
-1
lines changed

3 files changed

+63
-1
lines changed

packages/browseros/chromium_patches/chrome/BUILD.gn

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
diff --git a/chrome/BUILD.gn b/chrome/BUILD.gn
2-
index 97f843f8133c4..0acbe29f11806 100644
2+
index 97f843f8133c4..7846f837e754d 100644
33
--- a/chrome/BUILD.gn
44
+++ b/chrome/BUILD.gn
55
@@ -18,6 +18,7 @@ import("//build/config/win/manifest.gni")
@@ -37,3 +37,12 @@ index 97f843f8133c4..0acbe29f11806 100644
3737
configs += [ ":chrome_dll_symbol_order" ]
3838
if (!is_component_build && !using_sanitizer) {
3939
configs += [ ":chrome_dll_symbol_exports" ]
40+
@@ -1492,7 +1499,7 @@ copy("visual_elements_resources") {
41+
sources = [
42+
"//chrome/app/theme/$branding_path_component/win/tiles/Logo.png",
43+
"//chrome/app/theme/$branding_path_component/win/tiles/SmallLogo.png",
44+
- "app/visual_elements_resources/chrome.VisualElementsManifest.xml",
45+
+ "app/visual_elements_resources/browseros.VisualElementsManifest.xml",
46+
]
47+
48+
if (is_chrome_branded) {
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
diff --git a/chrome/app/visual_elements_resources/browseros.VisualElementsManifest.xml b/chrome/app/visual_elements_resources/browseros.VisualElementsManifest.xml
2+
new file mode 100644
3+
index 0000000000000..a7bb10b4056e2
4+
--- /dev/null
5+
+++ b/chrome/app/visual_elements_resources/browseros.VisualElementsManifest.xml
6+
@@ -0,0 +1,10 @@
7+
+<!-- This is only meant to be copied by chrome.exe in developer builds. -->
8+
+<Application xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
9+
+ <VisualElements
10+
+ BackgroundColor="#212121"
11+
+ ShowNameOnSquare150x150Logo="on"
12+
+ ForegroundText="light"
13+
+ Square150x150Logo="Logo.png"
14+
+ Square70x70Logo="SmallLogo.png"
15+
+ Square44x44Logo="SmallLogo.png"/>
16+
+</Application>
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
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
2+
index 1a62480aee22c..2b678add30238 100644
3+
--- a/chrome/browser/ui/views/frame/browser_window_property_manager_win.cc
4+
+++ b/chrome/browser/ui/views/frame/browser_window_property_manager_win.cc
5+
@@ -6,6 +6,7 @@
6+
7+
#include "base/command_line.h"
8+
#include "base/functional/bind.h"
9+
+#include "base/path_service.h"
10+
#include "base/strings/utf_string_conversions.h"
11+
#include "base/win/windows_version.h"
12+
#include "chrome/browser/browser_process.h"
13+
@@ -17,6 +18,7 @@
14+
#include "chrome/browser/web_applications/extensions/web_app_extension_shortcut.h"
15+
#include "chrome/browser/web_applications/web_app_helpers.h"
16+
#include "chrome/common/pref_names.h"
17+
+#include "chrome/installer/util/install_util.h"
18+
#include "components/prefs/pref_service.h"
19+
#include "extensions/browser/extension_registry.h"
20+
#include "ui/base/win/shell.h"
21+
@@ -87,6 +89,16 @@ void BrowserWindowPropertyManager::UpdateWindowProperties() {
22+
shortcut_manager->GetShortcutProperties(profile->GetPath(), &command_line,
23+
&pinned_name, &icon_path);
24+
command_line_string = command_line.GetCommandLineString();
25+
+ } else if (browser->is_type_normal() || browser->is_type_popup()) {
26+
+ // Fallback: Set basic relaunch details using the current executable.
27+
+ // This ensures taskbar pinning works correctly even when the profile
28+
+ // icon hasn't been created yet (e.g., in developer builds).
29+
+ base::FilePath exe_path;
30+
+ if (base::PathService::Get(base::FILE_EXE, &exe_path)) {
31+
+ icon_path = exe_path;
32+
+ command_line_string = L"\"" + exe_path.value() + L"\"";
33+
+ pinned_name = InstallUtil::GetDisplayName();
34+
+ }
35+
}
36+
ui::win::SetAppDetailsForWindow(app_id, icon_path, 0, command_line_string,
37+
pinned_name, hwnd_);

0 commit comments

Comments
 (0)