Skip to content

Commit

Permalink
fix: app.dock.setIcon() crash before app ready (#36292)
Browse files Browse the repository at this point in the history
fix: dock.setIcon() crash before app ready

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
  • Loading branch information
trop[bot] and codebytere committed Nov 9, 2022
1 parent e8b8ee1 commit 870bf8c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions shell/browser/browser_mac.mm
Expand Up @@ -444,6 +444,13 @@
image = native_image->image();
}

// This is needed when this fn is called before the browser
// process is ready, since supported scales are normally set
// by ui::ResourceBundle::InitSharedInstance
// during browser process startup.
if (!is_ready())
gfx::ImageSkia::SetSupportedScales({1.0f});

[[AtomApplication sharedApplication]
setApplicationIconImage:image.AsNSImage()];
}
Expand Down

0 comments on commit 870bf8c

Please sign in to comment.