Skip to content

Commit 25aa434

Browse files
authored
fix(core): prepare window icon and menu on remote URLs, closes #4131 (#4140)
1 parent 3e702cf commit 25aa434

2 files changed

Lines changed: 19 additions & 14 deletions

File tree

.changes/fix-window-remote-url.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"tauri": patch
3+
---
4+
5+
Prepare window icon and menu even when loading remote URLs. Previously it was behind a `is local URL?` condition.

core/tauri/src/manager.rs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -458,20 +458,6 @@ impl<R: Runtime> WindowManager<R> {
458458

459459
pending.webview_attributes = webview_attributes;
460460

461-
if !pending.window_builder.has_icon() {
462-
if let Some(default_window_icon) = self.inner.default_window_icon.clone() {
463-
pending.window_builder = pending
464-
.window_builder
465-
.icon(default_window_icon.try_into()?)?;
466-
}
467-
}
468-
469-
if pending.window_builder.get_menu().is_none() {
470-
if let Some(menu) = &self.inner.menu {
471-
pending = pending.set_menu(menu.clone());
472-
}
473-
}
474-
475461
let mut registered_scheme_protocols = Vec::new();
476462

477463
for (uri_scheme, protocol) in &self.inner.uri_scheme_protocols {
@@ -1118,6 +1104,20 @@ impl<R: Runtime> WindowManager<R> {
11181104

11191105
pending.url = url.to_string();
11201106

1107+
if !pending.window_builder.has_icon() {
1108+
if let Some(default_window_icon) = self.inner.default_window_icon.clone() {
1109+
pending.window_builder = pending
1110+
.window_builder
1111+
.icon(default_window_icon.try_into()?)?;
1112+
}
1113+
}
1114+
1115+
if pending.window_builder.get_menu().is_none() {
1116+
if let Some(menu) = &self.inner.menu {
1117+
pending = pending.set_menu(menu.clone());
1118+
}
1119+
}
1120+
11211121
if is_local {
11221122
let label = pending.label.clone();
11231123
pending = self.prepare_pending_window(

0 commit comments

Comments
 (0)