x11_capture: pass shared_window_class to run_with_x11; fix app change detection
The X11 capture path was calling check_app_change_with X11 window IDs instead of class names (gnome-terminal-server), corrupting the app state. Also pass shared_window_class to run_with_x11 so it can use the correct class for app detection.
This commit is contained in:
parent
8d68edb321
commit
88a64224b6
1 changed files with 6 additions and 2 deletions
|
|
@ -896,6 +896,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||||
capture,
|
capture,
|
||||||
&mut daemon,
|
&mut daemon,
|
||||||
shared_active_window,
|
shared_active_window,
|
||||||
|
shared_window_class,
|
||||||
config_changed,
|
config_changed,
|
||||||
status_changed,
|
status_changed,
|
||||||
engine_enabled,
|
engine_enabled,
|
||||||
|
|
@ -993,6 +994,7 @@ fn run_with_x11(
|
||||||
mut capture: X11Capture,
|
mut capture: X11Capture,
|
||||||
daemon: &mut Daemon,
|
daemon: &mut Daemon,
|
||||||
shared_active_window: Arc<Mutex<String>>,
|
shared_active_window: Arc<Mutex<String>>,
|
||||||
|
shared_window_class: Arc<Mutex<String>>,
|
||||||
config_changed: Arc<AtomicBool>,
|
config_changed: Arc<AtomicBool>,
|
||||||
status_changed: Arc<AtomicBool>,
|
status_changed: Arc<AtomicBool>,
|
||||||
_engine_enabled: Arc<AtomicBool>,
|
_engine_enabled: Arc<AtomicBool>,
|
||||||
|
|
@ -1026,8 +1028,10 @@ fn run_with_x11(
|
||||||
}
|
}
|
||||||
|
|
||||||
if daemon.config.app_state.enabled {
|
if daemon.config.app_state.enabled {
|
||||||
let active_window = shared_active_window.lock().unwrap().clone();
|
let class = shared_window_class.lock().unwrap().clone();
|
||||||
daemon.check_app_change_with(active_window);
|
if !class.is_empty() {
|
||||||
|
daemon.check_app_change_with(class);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reset on focus loss (VMK technique)
|
// Reset on focus loss (VMK technique)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue