Age | Commit message (Collapse) | Author | Files | Lines |
|
Just let Dispatch() check for a noClientException, rather than making
every single dispatch procedure take care of it.
Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
|
|
The only remaining X-functions used in server are XNF*, the rest is converted to
plain alloc/calloc/realloc/free/strdup.
X* functions are still exported from server and x* macros are still defined in
header file, so both ABI and API are not affected by this change.
Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
In the process, fixes a memory leak in CloseDevice, and an unchecked
memory allocation in InitializePredictableAccelerationProperties.
Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
|
|
Reintroduce a check which used to be there in the old
ProcessKeyboardEvent/ProcessPointerEvent codepath, which avoids us
recording events subject to a grab twice: once when it's first processed
in EnqueueEvent, and then again when it's thawed and being replayed.
This required a tiny amount of code motion to expose syncEvents.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
RECORD was disabled during the switch to internal events. This patch
modifies the record callback to work with internal events instead of
xEvents. The InternalEvents are converted to core/Xi events as needed.
Since record is a loadable extension, the EventTo* calls must be externed.
Signed-off-by: Chris Dekter <cdekter@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
If the indicator flags have the XkbSLI_IsDefault bit set, the indicator map
and names aren't their own bit of memory but rather point into the
device->key->xkbInfo->desc structure. XkbCopySrvLedInfo knows about this and
leaves the pointers alone.
When copying the classes from the slave to the master, these pointers are
copied and still point to the dev->key class of the slave device. If the
slave device is removed, the memory becomes invalid and a call to modify
this data (e.g. XkbSetIndicators) may cause a deadlock.
The copying of dev->key relies on dev->kbdfeed to be already set up. Hence
the pointers need to be reset once _both_ kbdfeed and key have been copied
into the master device.
X.Org Bug 25640 <http://bugs.freedesktop.org/show_bug.cgi?id=25640>
Fedora Bug 540584 <https://bugzilla.redhat.com/show_bug.cgi?id=540584>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
|
|
(cherry picked from commit 6d436e17a9ae7f4ce8537f3fabc052d4f07ca75f)
|
|
(cherry picked from commit 85d6402354cdf143c6490f2725744c2f08b5605b)
|
|
Subpixel data in data_frac is stored as FP32.32, hence we need to get that
down again before adding it to the current value.
Reported-by: Thomas Jaeger
Tested-by: Thomas Jaeger
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
To avoid confusion, the member names are now postfixed with _event.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
For core and XI1 events, store the key_repeat flag in the sequence number
until TryClientEvents. The sequenceNumber is unset until TryClientEvents.
[Also thrown in, some random indentation changes. Thanks]
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
The only failure point can be a BadAlloc.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
Fixes crash if the first XISelectEvents has a zero sized event mask.
Fixes crash if the mask provided is larger than others->xi2mask[].
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
A missing break meant that ButtonPress would fall through into
ButtonRelease, but luckily it appears to have been completely harmless.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
|
|
GrabKey and GrabButton are only called from XI/XI2 code. Set type to -1,
just in case.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
DCEs are now processed when sent throught the master device, not when sent
through the slave device. This includes a removal of some un-used (or partly
used) fields in the DCE itself to something more self-explanatory.
TODO: if a device has events queued and its attachment is changed, the DCE
is silently dropped now. Instead, it should be generated as soon as the
first event after the attachment is sent.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
The version in eventconvert.c was half broken and for some reason we ended
up with a second version in exevents.c (which works). Move it over to where
it belongs and call EventToXI2 instad of having a custom function for it.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
If a new device posts an event while the DCE is in the queue, getting the
data from the device may result in invalid memory access.
X.Org Bug 23100 <http://bugs.freedesktop.org/show_bug.cgi?id=23100>
|
|
Unlike Enter/Leave events generated by a device pushing the pointer around,
a device doesn't change focus all by itself. It's a result of a
SetInputFocus call, a window becoming unviewable or a grab activating. As
such, the sourceid for focus events is always the deviceid itself.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
Use enum EventType instead of ints. This requires a load of default
cases in various switch statements to silence compiler warnings.
Reported-by: Aaron Plattner
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
InternalEvents shouldn't be used anywhere outside the X server itself. Split
up into events.h for opaque typedefs for the events needed by various
headers and eventstr.h for the actual struct definitions.
eventstr.h must only be included by code that requires internal events and
is not part of the SDK.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
Require inputproto 1.9.99.13
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
New access modes are being passed to the device access hook for XI2:
DixCreateAccess for creating a new master device;
DixAdd/RemoveAccess for attaching/removing slave devices to a master; and
DixListProp/GetProp/SetPropAccess for device properties.
Refer to the XACE-Spec document in xorg-docs, section "Device Access."
Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov>
|
|
Master devices provide the union of all attached slave devices' buttons,
i.e. the number of buttons on the master device is always the number of
buttons of the slave device with the highest number of buttons. When slaves
are attached or detached, the master device adjusts the button number to
reflect the new buttons.
On a slave switch, this slave's button labels are copied into the master (up
to slave->num_buttons). The remaining button labels (if any) stay as they
are. Thus, if any of the higher buttons is still pressed, it reflects the
label of the last pressed device that provided this button.
If two devices press the same button and it is differently labelled the last
pressed one will be reflected in the master device.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
With subpixel support, uint just doesn't cut it.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
The previous code would always skip the last valuator due to a wrong
upper boundary in the loop. last_valuator is the index of the last set
valuator - which also means it must be initialized to -1, not 0.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
Without this line the device's axis values don't get updated properly for
pure motion events.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
Some files (notably those merged with MPX before XI2 came along) didn't use
a 'xi' prefix. This patch changes all of them to meaningful names.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
zero-length masks are supposed to clear the device's mask.
ProcXISelectEvents passes these masks through directly, so we need to clear
the bits here if such a mask is supplied.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
If a passive enter or focus in grab activates, send additional enter or
focus events with mode XIPassiveGrabNotify to the grabbing client.
Likewise, if the grab deactivates, send additional leave or focus out
events.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
Enter grabs are checked for in CheckMotion(), each time the sprite window
changes the current grab is deactivated (if applicable) and the new grab is
activated (if applicable). Exception - if the grab is on a parent window of
the current window since we keep the grab across descendants.
Since CheckMotion() may change the grab status of a device, we mustn't get
"dev->deviceGrab.grab" in ProcessOtherEvents until after CheckMotion().
FocusIn grabs are checked in much the same manner.
The event delivery for grabs replaces the NotifyNormal on window change with
a NotifyGrab on window change. Note that this happens before the grab
activates, so the EnterNotify(NotifyGrab) is still delivered to the window,
not to the grabbing client. This is in line with the core protocol semantics
for NotifyGrab events.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
In the case of a RevertToFollowKeyboard, the master device should be used
(since this is the closest equivalent to the VCK as before). Only if the
master keyboard is the same as the device, revert to the VCK itself.
|
|
This didn't use to be a problem when devices could only be pointers or
keyboards, not both. Nowadays, slave devices may have both buttons and
keyboards, and in this case we don't want to deactivate a passive keyboard
grab when a button release is detected.
|
|
There's devices (e.g. some barcode readers) that have axes but no buttons.
When such a device sends a motion event, the valuator and button class is
copied into the master pointer (i.e. removing the button class).
So we need a couple of extra sanity checks for the button class to exist.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
Copying all classes into the master device has drawbacks for hybrid devices
(devices that are both mice and keyboards). If such a device posts an event,
it's key classes are moved into the VCP. The key event itself is unaffected
by keyboard grabs and the like.
Partial class copying copies depending on the event and copies the classes
into the right master device (i.e. the VCK for key events, the VCP for
pointer events).
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
There's no need for internal events to be a struct with a single nested
union, we might as well make the union itself the InternalEvent.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
isMaster is not enough as long as we differ between master pointers and
keyboard. With flexible device classes, the usual checks for whether a
master device is a pointer (currently check for ->button, ->valuators or
->key) do not work as an SD may post an event through a master and mess this
check up.
Example, a device with valuators but no buttons would remove the button
class from the VCP and thus result in the
IsPointerDevice(inputInfo.pointer) == FALSE.
This will become worse in the future when new device classes are introduced
that aren't provided in the current system (e.g. a switch class).
This patch replaces isMaster with "type", one of SLAVE, MASTER_POINTER and
MASTER_KEYBOARD. All checks for dev->isMaster are replaced with an
IsMaster(dev).
|
|
dev->u.lastSlave was not signal safe since it was accessed by the DIX and
during signal handling.
Replaced with:
'dev->last.slave' for the signal handler's lastSlave (used to generate
DeviceChangedEvents), .
'dev->u.lastSlave' for the DIX lastSlave (currently only used in
change_modmap)
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
We don't do keycode grabs in XI2, they're pointless.
|
|
Key events may change the modifier state, so we need to get the prev_state for
those (i.e. without the changes by the event already applied).
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|