[at-spi2-core: 1/2] registryd: unlock capslock during keysym synthesis




commit 1d62e20bfd0637265343efd285e70a7bd4597fbf
Author: Samuel Thibault <samuel thibault ens-lyon org>
Date:   Wed Jan 26 01:03:31 2022 +0100

    registryd: unlock capslock during keysym synthesis
    
    otherwise the synthesized keysyms would be affected by the capslock
    state, thus producing unexpected capitalized result when an AT tries to
    synthesize text.
    
    Fixes #50

 registryd/deviceeventcontroller.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
---
diff --git a/registryd/deviceeventcontroller.c b/registryd/deviceeventcontroller.c
index 942f383b..4111e8f3 100644
--- a/registryd/deviceeventcontroller.c
+++ b/registryd/deviceeventcontroller.c
@@ -1696,12 +1696,17 @@ spi_dec_synth_keysym (SpiDEController *controller, long keysym)
        if (synth_mods != modifiers) {
                lock_mods = synth_mods & ~modifiers;
                spi_dec_plat_lock_modifiers (controller, lock_mods);
+               if (modifiers & LockMask)
+                       spi_dec_plat_unlock_modifiers (controller, LockMask);
        }
        spi_dec_plat_synth_keycode_press (controller, key_synth_code);
        spi_dec_plat_synth_keycode_release (controller, key_synth_code);
 
-       if (synth_mods != modifiers) 
+       if (synth_mods != modifiers) {
                spi_dec_plat_unlock_modifiers (controller, lock_mods);
+               if (modifiers & LockMask)
+                       spi_dec_plat_lock_modifiers (controller, LockMask);
+       }
        return TRUE;
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]