fix: reuse wgpu compositor across windows
This commit is contained in:
parent
dcf4cf0194
commit
f725961c87
1 changed files with 30 additions and 23 deletions
|
|
@ -864,6 +864,7 @@ async fn run_instance<P>(
|
||||||
platform_specific_handler.send_wayland(
|
platform_specific_handler.send_wayland(
|
||||||
platform_specific::Action::TrackWindow(window.clone(), id),
|
platform_specific::Action::TrackWindow(window.clone(), id),
|
||||||
);
|
);
|
||||||
|
if compositor.is_none() {
|
||||||
match create_compositor::<P>(
|
match create_compositor::<P>(
|
||||||
window.clone(),
|
window.clone(),
|
||||||
CreateCompositor {
|
CreateCompositor {
|
||||||
|
|
@ -888,6 +889,7 @@ async fn run_instance<P>(
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
let window_theme = window
|
let window_theme = window
|
||||||
.theme()
|
.theme()
|
||||||
|
|
@ -1014,6 +1016,7 @@ async fn run_instance<P>(
|
||||||
&mut is_window_opening,
|
&mut is_window_opening,
|
||||||
&mut system_theme,
|
&mut system_theme,
|
||||||
&mut platform_specific_handler,
|
&mut platform_specific_handler,
|
||||||
|
is_daemon,
|
||||||
);
|
);
|
||||||
if exited {
|
if exited {
|
||||||
runtime.track(None.into_iter());
|
runtime.track(None.into_iter());
|
||||||
|
|
@ -1171,6 +1174,7 @@ async fn run_instance<P>(
|
||||||
&mut is_window_opening,
|
&mut is_window_opening,
|
||||||
&mut system_theme,
|
&mut system_theme,
|
||||||
&mut platform_specific_handler,
|
&mut platform_specific_handler,
|
||||||
|
is_daemon,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1369,6 +1373,7 @@ async fn run_instance<P>(
|
||||||
&mut is_window_opening,
|
&mut is_window_opening,
|
||||||
&mut system_theme,
|
&mut system_theme,
|
||||||
&mut platform_specific_handler,
|
&mut platform_specific_handler,
|
||||||
|
is_daemon,
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
window.state.update(&program, window.raw.as_ref(), &event);
|
window.state.update(&program, window.raw.as_ref(), &event);
|
||||||
|
|
@ -1562,6 +1567,7 @@ async fn run_instance<P>(
|
||||||
&mut is_window_opening,
|
&mut is_window_opening,
|
||||||
&mut system_theme,
|
&mut system_theme,
|
||||||
&mut platform_specific_handler,
|
&mut platform_specific_handler,
|
||||||
|
is_daemon,
|
||||||
);
|
);
|
||||||
if exited {
|
if exited {
|
||||||
runtime.track(None.into_iter());
|
runtime.track(None.into_iter());
|
||||||
|
|
@ -2106,6 +2112,7 @@ fn run_action<'a, P, C>(
|
||||||
is_window_opening: &mut bool,
|
is_window_opening: &mut bool,
|
||||||
system_theme: &mut theme::Mode,
|
system_theme: &mut theme::Mode,
|
||||||
platform_specific: &mut crate::platform_specific::PlatformSpecific,
|
platform_specific: &mut crate::platform_specific::PlatformSpecific,
|
||||||
|
is_daemon: bool,
|
||||||
) -> bool
|
) -> bool
|
||||||
where
|
where
|
||||||
P: Program,
|
P: Program,
|
||||||
|
|
@ -2190,7 +2197,7 @@ where
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
if window_manager.is_empty() {
|
if window_manager.is_empty() && !is_daemon {
|
||||||
*compositor = None;
|
*compositor = None;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue