Reduce CPU usage while window is unfocused and not hovered over

Only render if window is focused, hovered, subscript is running,
or coroutine is active.

Closes #18
This commit is contained in:
meehl committed 2025-11-28 18:30:25 +01:00
1 parent 0066a05e13
commit ae6a24f82c
9 files changed
+116 -30

No files matched your search

+5
View File
@@ -68,9 +68,14 @@ impl PoBMode {
let identical = layers_hash == self.previous_layers_hash;
self.previous_layers_hash = layers_hash;
let has_active_subscript = self.lua_instance.has_running_subscripts();
let has_active_coroutine = self.lua_instance.has_active_coroutine();
let should_continue = has_active_subscript || has_active_coroutine;
Ok(ModeFrameOutput {
primitives: self.state.layers.consume_layers(),
can_elide: identical,
should_continue,
})
}