password: call check_password_field() instead of stale cached is_password_field()

The keymap and evdev paths were calling is_password_field() which returns
the cached value from AppStateManager. But check_password_field() (the
fresh AT-SPI2 check) was never called in these paths, so password
detection always returned false — engine remained enabled in password
fields, causing VNI processing of password input.
This commit is contained in:
Khoa Vo 2026-07-02 14:54:22 +07:00
parent fbe0baf7ab
commit 2553f20466

View file

@ -1245,10 +1245,11 @@ fn run_with_x11_keymap(
continue; continue;
} }
// Password detection — also reset buffers on transition to prevent // Password detection (fresh AT-SPI2 check) — also reset buffers
// stale engine content bleeding into the password field // on transition to prevent stale engine content bleeding into
// the password field (same-window field switch).
if daemon.config.app_state.enabled { if daemon.config.app_state.enabled {
let is_pw = daemon.app_state.is_password_field(); let is_pw = daemon.app_state.check_password_field();
let currently_enabled = daemon.engine.is_enabled(); let currently_enabled = daemon.engine.is_enabled();
if is_pw && currently_enabled { if is_pw && currently_enabled {
daemon.engine.set_enabled(false); daemon.engine.set_enabled(false);
@ -1467,11 +1468,11 @@ fn run_with_evdev(
continue; continue;
} }
// Password field check: disable engine if typing into a password field. // Password field check (fresh AT-SPI2 check): disable engine if typing
// Also reset buffers on transition to prevent stale engine content // into a password field. Also reset buffers on transition to prevent
// bleeding into the password field (same-window field switch). // stale engine content bleeding into the password field.
if value == 1 { if value == 1 {
let is_pw = daemon.app_state.is_password_field(); let is_pw = daemon.app_state.check_password_field();
let currently_enabled = daemon.engine.is_enabled(); let currently_enabled = daemon.engine.is_enabled();
if is_pw && currently_enabled { if is_pw && currently_enabled {
daemon.engine.set_enabled(false); daemon.engine.set_enabled(false);