Skip to content

Commit

Permalink
fix(core): prepare window icon and menu on remote URLs, closes #4131 (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasfernog committed May 16, 2022
1 parent 3e702cf commit 25aa434
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 14 deletions.
5 changes: 5 additions & 0 deletions .changes/fix-window-remote-url.md
@@ -0,0 +1,5 @@
---
"tauri": patch
---

Prepare window icon and menu even when loading remote URLs. Previously it was behind a `is local URL?` condition.
28 changes: 14 additions & 14 deletions core/tauri/src/manager.rs
Expand Up @@ -458,20 +458,6 @@ impl<R: Runtime> WindowManager<R> {

pending.webview_attributes = webview_attributes;

if !pending.window_builder.has_icon() {
if let Some(default_window_icon) = self.inner.default_window_icon.clone() {
pending.window_builder = pending
.window_builder
.icon(default_window_icon.try_into()?)?;
}
}

if pending.window_builder.get_menu().is_none() {
if let Some(menu) = &self.inner.menu {
pending = pending.set_menu(menu.clone());
}
}

let mut registered_scheme_protocols = Vec::new();

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

pending.url = url.to_string();

if !pending.window_builder.has_icon() {
if let Some(default_window_icon) = self.inner.default_window_icon.clone() {
pending.window_builder = pending
.window_builder
.icon(default_window_icon.try_into()?)?;
}
}

if pending.window_builder.get_menu().is_none() {
if let Some(menu) = &self.inner.menu {
pending = pending.set_menu(menu.clone());
}
}

if is_local {
let label = pending.label.clone();
pending = self.prepare_pending_window(
Expand Down

0 comments on commit 25aa434

Please sign in to comment.