summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Gorse <mgorse@suse.com>2021-04-29 13:22:17 -0500
committerMike Gorse <mgorse@suse.com>2021-04-29 13:22:17 -0500
commit9efa51d2455bb832a3eca3c9ebd19ddbd27f4f49 (patch)
tree5ec4a820f9fa40156dea7c883ac709e4b99b4d6a
parent0b551954386543e97370d97ea1b78dd096edb14e (diff)
downloadat-spi2-core-9efa51d2455bb832a3eca3c9ebd19ddbd27f4f49.tar.gz
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.
-rw-r--r--registryd/deviceeventcontroller-x11.c2
-rw-r--r--registryd/deviceeventcontroller.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/registryd/deviceeventcontroller-x11.c b/registryd/deviceeventcontroller-x11.c
index df16bd8c..55239f4f 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 acd089ba..942f383b 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;