refactor: allow resetting the main window id

This commit is contained in:
Ashley Wulber 2024-10-21 17:32:16 -04:00 committed by Ashley Wulber
parent b44fe2c0b6
commit cf3ba4ca07
5 changed files with 29 additions and 24 deletions

View file

@ -419,9 +419,9 @@ pub fn run<App: Application>(flags: App::Flags) -> iced::Result {
cosmic::Cosmic::update,
cosmic::Cosmic::view,
);
if core.main_window.get().is_none() {
if core.main_window.is_none() {
app = app.window(window_settings.clone());
_ = core.main_window.set(iced_core::window::Id::RESERVED);
core.main_window = Some(iced_core::window::Id::RESERVED);
}
app.subscription(cosmic::Cosmic::subscription)
.style(cosmic::Cosmic::style)