diff options
Diffstat (limited to 'xorg-server')
-rw-r--r-- | xorg-server/Xext/geext.c | 9 | ||||
-rw-r--r-- | xorg-server/dix/eventconvert.c | 14 | ||||
-rw-r--r-- | xorg-server/dix/getevents.c | 4 | ||||
-rw-r--r-- | xorg-server/xkeyboard-config/rules/base.xml.in | 2 |
4 files changed, 15 insertions, 14 deletions
diff --git a/xorg-server/Xext/geext.c b/xorg-server/Xext/geext.c index 93e5277cc..5e7b9c29b 100644 --- a/xorg-server/Xext/geext.c +++ b/xorg-server/Xext/geext.c @@ -49,6 +49,7 @@ static const int version_requests[] = { static void SGEGenericEvent(xEvent* from, xEvent* to);
#define NUM_VERSION_REQUESTS (sizeof (version_requests) / sizeof (version_requests[0]))
+#define EXT_MASK(ext) ((ext) & 0x7F)
/************************************************************/
/* request handlers */
@@ -191,8 +192,8 @@ SGEGenericEvent(xEvent* from, xEvent* to) return;
}
- if (GEExtensions[gefrom->extension & 0x7F].evswap)
- GEExtensions[gefrom->extension & 0x7F].evswap(gefrom, geto);
+ if (GEExtensions[EXT_MASK(gefrom->extension)].evswap)
+ GEExtensions[EXT_MASK(gefrom->extension)].evswap(gefrom, geto);
}
/* Init extension, register at server.
@@ -241,11 +242,11 @@ void GERegisterExtension(int extension,
void (*ev_swap)(xGenericEvent* from, xGenericEvent* to))
{
- if ((extension & 0x7F) >= MAXEXTENSIONS)
+ if (EXT_MASK(extension) >= MAXEXTENSIONS)
FatalError("GE: extension > MAXEXTENSIONS. This should not happen.\n");
/* extension opcodes are > 128, might as well save some space here */
- GEExtensions[extension & 0x7f].evswap = ev_swap;
+ GEExtensions[EXT_MASK(extension)].evswap = ev_swap;
}
diff --git a/xorg-server/dix/eventconvert.c b/xorg-server/dix/eventconvert.c index 6af142860..4fe325922 100644 --- a/xorg-server/dix/eventconvert.c +++ b/xorg-server/dix/eventconvert.c @@ -383,12 +383,12 @@ getValuatorEvents(DeviceEvent *ev, deviceValuator *xv) int i;
int state = 0;
int first_valuator, num_valuators;
- DeviceIntPtr dev = NULL;
num_valuators = countValuators(ev, &first_valuator);
if (num_valuators > 0)
{
+ DeviceIntPtr dev = NULL;
dixLookupDevice(&dev, ev->deviceid, serverClient, DixUseAccess);
/* State needs to be assembled BEFORE the device is updated. */
state = (dev && dev->key) ? XkbStateFieldFromRec(&dev->key->xkbInfo->state) : 0;
@@ -405,14 +405,10 @@ getValuatorEvents(DeviceEvent *ev, deviceValuator *xv) xv->deviceid = ev->deviceid;
xv->device_state = state;
- for (j = 0; j < xv->num_valuators; j++) {
- if (BitIsOn(ev->valuators.mask, xv->first_valuator + j))
- valuators[j] = ev->valuators.data[xv->first_valuator + j];
- else if (dev->valuator->axes[xv->first_valuator + j].mode == Absolute)
- valuators[j] = dev->valuator->axisVal[xv->first_valuator + j];
- else
- valuators[j] = 0;
- }
+ /* Unset valuators in masked valuator events have the proper data values
+ * in the case of an absolute axis in between two set valuators. */
+ for (j = 0; j < xv->num_valuators; j++)
+ valuators[j] = ev->valuators.data[xv->first_valuator + j];
if (i + 6 < num_valuators)
xv->deviceid |= MORE_EVENTS;
diff --git a/xorg-server/dix/getevents.c b/xorg-server/dix/getevents.c index 7f273fb2d..c8fb48192 100644 --- a/xorg-server/dix/getevents.c +++ b/xorg-server/dix/getevents.c @@ -220,6 +220,8 @@ set_valuators(DeviceIntPtr dev, DeviceEvent* event, ValuatorMask *mask) {
int i;
+ /* Set the data to the previous value for unset absolute axes. The values
+ * may be used when sent as part of an XI 1.x valuator event. */
for (i = 0; i < valuator_mask_size(mask); i++)
{
if (valuator_mask_isset(mask, i))
@@ -231,6 +233,8 @@ set_valuators(DeviceIntPtr dev, DeviceEvent* event, ValuatorMask *mask) event->valuators.data_frac[i] =
dev->last.remainder[i] * (1 << 16) * (1 << 16);
}
+ else if (valuator_get_mode(dev, i) == Absolute)
+ event->valuators.data[i] = dev->valuator->axisVal[i];
}
}
diff --git a/xorg-server/xkeyboard-config/rules/base.xml.in b/xorg-server/xkeyboard-config/rules/base.xml.in index 2257d156f..1a2377843 100644 --- a/xorg-server/xkeyboard-config/rules/base.xml.in +++ b/xorg-server/xkeyboard-config/rules/base.xml.in @@ -5459,7 +5459,7 @@ <option>
<configItem>
<name>lv3:bksl_switch_latch</name>
- <_description>Backslash chooses 3rd level, latches when pressed together with another 3rd-level-chooser)</_description>
+ <_description>Backslash (chooses 3rd level, latches when pressed together with another 3rd-level-chooser)</_description>
</configItem>
</option>
<option>
|