fix(ibus): preserve user engine for dead keys (#457)
* fix(ibus): preserve user engine for dead keys Keep the VocaLinux IBus engine warm without selecting it as the active keyboard engine. Temporarily switch to the VocaLinux engine only while committing dictated text, then restore the user's previous IBus engine. Wait for the IBus commit to complete before acknowledging socket injection, so engine restoration does not race the commit. This fixes dead-key composition (e.g. ^ + e → ê) on French AZERTY and other layouts that rely on the active IBus/XKB engine for compose state. Fixes #442 Supersedes #446 (rebased onto main after thread-safety hardening in #452) * test(ibus): add coverage for scoped activation error paths Cover previously-untested error paths in inject_text() scoped activation: - switch_engine failure during temporary Vocalinux activation - unknown current engine (get_current_engine returns None) - NO_ENGINE retry when previous engine could not be captured - ConnectionRefusedError exhausting all retries - FileNotFoundError retry-then-succeed and retry-then-fail - Generic exception catch-all
This commit is contained in:
@@ -415,7 +415,7 @@ class TestBackgroundIBusInitialization(unittest.TestCase):
|
||||
|
||||
obj = _make_injector(DesktopEnvironment.WAYLAND)
|
||||
obj._ibus_injector = MagicMock()
|
||||
obj._ibus_injector._setup_engine.side_effect = RuntimeError("not ready")
|
||||
obj._ibus_injector.prepare_engine.side_effect = RuntimeError("not ready")
|
||||
|
||||
obj._initialize_ibus_in_background()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user