diff options
author | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2018-11-01 20:12:44 +0100 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2018-11-01 20:12:44 +0100 |
commit | 122db3fde2b934df206567abc0c8b431962ce4b3 (patch) | |
tree | 5435567977fca83801096f971ded62b129c65f73 /nx-X11/programs/Xserver/Xi/exevents.c | |
parent | 70b49467c41e51eb11a50e4cbe3652246bf21140 (diff) | |
parent | 266c3d68d5abae1de80e807dbbe3252b34c4a04f (diff) | |
download | nx-libs-122db3fde2b934df206567abc0c8b431962ce4b3.tar.gz nx-libs-122db3fde2b934df206567abc0c8b431962ce4b3.tar.bz2 nx-libs-122db3fde2b934df206567abc0c8b431962ce4b3.zip |
Merge branch 'uli42-pr/Xi-1.2.0' into 3.6.x
Attributes GH PR #734: https://github.com/ArcticaProject/nx-libs/pull/734
Diffstat (limited to 'nx-X11/programs/Xserver/Xi/exevents.c')
-rw-r--r-- | nx-X11/programs/Xserver/Xi/exevents.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/nx-X11/programs/Xserver/Xi/exevents.c b/nx-X11/programs/Xserver/Xi/exevents.c index e614b5af9..428e577f7 100644 --- a/nx-X11/programs/Xserver/Xi/exevents.c +++ b/nx-X11/programs/Xserver/Xi/exevents.c @@ -174,6 +174,9 @@ ProcessOtherEvent(xEventPtr xE, register DeviceIntPtr other, int count) } if (xE->u.u.type == DeviceKeyPress) { + if (!k) + return; + modifiers = k->modifierMap[key]; kptr = &k->down[key >> 3]; if (*kptr & bit) { /* allow ddx to generate multiple downs */ @@ -203,6 +206,9 @@ ProcessOtherEvent(xEventPtr xE, register DeviceIntPtr other, int count) return; } } else if (xE->u.u.type == DeviceKeyRelease) { + if (!k) + return; + kptr = &k->down[key >> 3]; if (!(*kptr & bit)) /* guard against duplicates */ return; @@ -225,6 +231,9 @@ ProcessOtherEvent(xEventPtr xE, register DeviceIntPtr other, int count) if (other->fromPassiveGrab && (key == other->activatingKey)) deactivateDeviceGrab = TRUE; } else if (xE->u.u.type == DeviceButtonPress) { + if (!b) + return; + kptr = &b->down[key >> 3]; *kptr |= bit; if (other->valuator) @@ -242,6 +251,9 @@ ProcessOtherEvent(xEventPtr xE, register DeviceIntPtr other, int count) return; } else if (xE->u.u.type == DeviceButtonRelease) { + if (!b) + return; + kptr = &b->down[key >> 3]; *kptr &= ~bit; if (other->valuator) @@ -1075,6 +1087,9 @@ MaybeSendDeviceMotionNotifyHint(deviceKeyButtonPointer * pEvents, Mask mask) DeviceIntPtr dev; dev = LookupDeviceIntRec(pEvents->deviceid & DEVICE_BITS); + if (!dev) + return 0; + if (pEvents->type == DeviceMotionNotify) { if (mask & DevicePointerMotionHintMask) { if (WID(dev->valuator->motionHintWindow) == pEvents->event) { @@ -1096,6 +1111,9 @@ CheckDeviceGrabAndHintWindow(WindowPtr pWin, int type, DeviceIntPtr dev; dev = LookupDeviceIntRec(xE->deviceid & DEVICE_BITS); + if (!dev) + return; + if (type == DeviceMotionNotify) dev->valuator->motionHintWindow = pWin; else if ((type == DeviceButtonPress) && (!grab) && |