diff options
author | marha <marha@users.sourceforge.net> | 2011-12-23 11:12:22 +0100 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2011-12-23 11:12:22 +0100 |
commit | 6f6a4d4a600eabf5d6a624eb5b0e98ee67afb52d (patch) | |
tree | 8dc28411ab42ebb9183bc090c10024a39fc669d6 /xorg-server/Xi/xiselectev.c | |
parent | 22891980a76b862bfcda406521b454f072090fb8 (diff) | |
parent | e22891346b85a7db40dec7260a100f90b451cbc8 (diff) | |
download | vcxsrv-6f6a4d4a600eabf5d6a624eb5b0e98ee67afb52d.tar.gz vcxsrv-6f6a4d4a600eabf5d6a624eb5b0e98ee67afb52d.tar.bz2 vcxsrv-6f6a4d4a600eabf5d6a624eb5b0e98ee67afb52d.zip |
Merge remote-tracking branch 'origin/released'
Conflicts:
xorg-server/glx/dispatch.h
xorg-server/glx/glapi.c
xorg-server/glx/indirect_dispatch.h
xorg-server/glx/indirect_reqsize.c
xorg-server/glx/indirect_reqsize.h
xorg-server/glx/indirect_size.h
xorg-server/glx/indirect_size_get.c
xorg-server/glx/indirect_size_get.h
xorg-server/glx/indirect_table.c
xorg-server/mi/mieq.c
Diffstat (limited to 'xorg-server/Xi/xiselectev.c')
-rw-r--r-- | xorg-server/Xi/xiselectev.c | 48 |
1 files changed, 47 insertions, 1 deletions
diff --git a/xorg-server/Xi/xiselectev.c b/xorg-server/Xi/xiselectev.c index ee14edb6d..1b6c47a87 100644 --- a/xorg-server/Xi/xiselectev.c +++ b/xorg-server/Xi/xiselectev.c @@ -145,13 +145,59 @@ ProcXISelectEvents(ClientPtr client) BitIsOn(bits, XI_RawKeyRelease) || BitIsOn(bits, XI_RawButtonPress) || BitIsOn(bits, XI_RawButtonRelease) || - BitIsOn(bits, XI_RawMotion)) + BitIsOn(bits, XI_RawMotion) || + BitIsOn(bits, XI_RawTouchBegin) || + BitIsOn(bits, XI_RawTouchUpdate) || + BitIsOn(bits, XI_RawTouchEnd)) { client->errorValue = XI_RawKeyPress; return BadValue; } } + if (evmask->mask_len >= 1) + { + unsigned char *bits = (unsigned char*)&evmask[1]; + + /* All three touch events must be selected at once */ + if ((BitIsOn(bits, XI_TouchBegin) || + BitIsOn(bits, XI_TouchUpdate) || + BitIsOn(bits, XI_TouchOwnership) || + BitIsOn(bits, XI_TouchEnd)) && + (!BitIsOn(bits, XI_TouchBegin) || + !BitIsOn(bits, XI_TouchUpdate) || + !BitIsOn(bits, XI_TouchEnd))) + { + client->errorValue = XI_TouchBegin; + return BadValue; + } + + /* Only one client per window may select for touch events on the + * same devices, including master devices. + * XXX: This breaks if a device goes from floating to attached. */ + if (BitIsOn(bits, XI_TouchBegin)) + { + OtherInputMasks *inputMasks = wOtherInputMasks(win); + InputClients *iclient = NULL; + if (inputMasks) + iclient = inputMasks->inputClients; + for (; iclient; iclient = iclient->next) + { + DeviceIntPtr dummy; + + if (CLIENT_ID(iclient->resource) == client->index) + continue; + + dixLookupDevice(&dummy, evmask->deviceid, serverClient, DixReadAccess); + if (!dummy) + return BadImplementation; /* this shouldn't happen */ + + if (xi2mask_isset(iclient->xi2mask, dummy, XI_TouchBegin)) + return BadAccess; + } + } + } + if (XICheckInvalidMaskBits(client, (unsigned char*)&evmask[1], evmask->mask_len * 4) != Success) return BadValue; |