[at-spi2-core] DeviceEventController: fix numlock detection



commit 9efa51d2455bb832a3eca3c9ebd19ddbd27f4f49
Author: Mike Gorse <mgorse suse com>
Date:   Thu Apr 29 13:22:17 2021 -0500

    DeviceEventController: fix numlock detection
    
    _numlock_physical_mask was defined in both deviceeventcontroller.c and
    deviceeventcontroller-x11.c, and only the latter version was being updated,
    so we might do the wrong thing if numlock is assigned to something other than
    mod2.

 registryd/deviceeventcontroller-x11.c | 2 +-
 registryd/deviceeventcontroller.c     | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/registryd/deviceeventcontroller-x11.c b/registryd/deviceeventcontroller-x11.c
index df16bd8..55239f4 100644
--- a/registryd/deviceeventcontroller-x11.c
+++ b/registryd/deviceeventcontroller-x11.c
@@ -82,7 +82,7 @@ static unsigned int mouse_button_mask =
   Button1Mask | Button2Mask | Button3Mask | Button4Mask | Button5Mask;
 static unsigned int key_modifier_mask =
   Mod1Mask | Mod2Mask | Mod3Mask | Mod4Mask | Mod5Mask | ShiftMask | LockMask | ControlMask | 
SPI_KEYMASK_NUMLOCK;
-static unsigned int _numlock_physical_mask = Mod2Mask; /* a guess, will be reset */
+extern unsigned int _numlock_physical_mask;
 
 static XModifierKeymap* xmkeymap = NULL;
 
diff --git a/registryd/deviceeventcontroller.c b/registryd/deviceeventcontroller.c
index acd089b..942f383 100644
--- a/registryd/deviceeventcontroller.c
+++ b/registryd/deviceeventcontroller.c
@@ -73,7 +73,7 @@ static unsigned int key_modifier_mask =
   SPI_KEYMASK_MOD1 | SPI_KEYMASK_MOD2 | SPI_KEYMASK_MOD3 | SPI_KEYMASK_MOD4 |
   SPI_KEYMASK_MOD5 | SPI_KEYMASK_SHIFT | SPI_KEYMASK_SHIFTLOCK |
   SPI_KEYMASK_CONTROL | SPI_KEYMASK_NUMLOCK;
-static unsigned int _numlock_physical_mask = SPI_KEYMASK_MOD2; /* a guess, will be reset */
+unsigned int _numlock_physical_mask = SPI_KEYMASK_MOD2; /* a guess, will be reset */
 
 static gboolean have_mouse_listener = FALSE;
 static gboolean have_mouse_event_listener = FALSE;


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