fix set/overlay persistence

This commit is contained in:
galister
2025-12-11 17:08:49 +09:00
parent d2a3b7cc63
commit 9c799f360d
13 changed files with 162 additions and 180 deletions

View File

@@ -251,7 +251,7 @@ where
if newly_created {
log::info!("Creating dashboard overlay");
let mut overlay = OverlayWindowData::from_config(OverlayWindowConfig {
let overlay = OverlayWindowData::from_config(OverlayWindowConfig {
default_state: OverlayWindowState {
interactable: true,
grabbable: true,
@@ -284,8 +284,6 @@ where
)?
});
overlay.config.reset(app, true);
let overlay_id = overlays.add(overlay, app);
wayvr.set_overlay_display_handle(overlay_id, disp_handle);
@@ -433,7 +431,14 @@ where
app.tasks.enqueue(TaskType::Overlay(OverlayTask::Modify(
OverlaySelector::Id(overlay_id),
Box::new(move |app, o| {
o.toggle(app);
if visible == o.is_active() {
return;
}
if visible {
o.activate(app);
} else {
o.deactivate();
}
}),
)));
}