Age | Commit message (Collapse) | Author | Files | Lines |
|
'event' must be freed before exiting.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit fd913136732ff14a0484ca28f60ac1fbf49be81d)
|
|
To avoid confusion, the member names are now postfixed with _event.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
silences compiler warning:
events.c: In function 'FixUpEventFromWindow':
events.c:2262: warning: 'child' may be used uninitialized in this function
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
Just in case we figure out a better way to do it in the future.
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>
|
|
Instead of a massive if (blah && blah), return early where possible.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
Referencing a window (as grab-window) only requires GetAttr access.
Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov>
|
|
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
When the windows are restructured, CheckMotion needs to be called for all
masters and floating slaves to update the spriteTrace.
X.Org Bug 23257 <http://bugs.freedesktop.org/show_bug.cgi?id=23257>
Tested-by: Thomas Jaeger
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
XI1 grabs on slave devices leave the device attached - just like in earlier
versions of XI.
Tested-by: Thomas Jaeger
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
This reverts commit 0c0ef42292f4c910c73b308cd75d77637312da53.
Tested-by: Thomas Jaeger
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
The sourceid for enter/leave events as a result of pointer motion is the ID
of the slave device. The sourceid for those as a result of a grab activating
is the device itself.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
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>
|
|
EventToXI2 returns a NULL event for enter/focus events since these events
aren't yet wrapped into internal events. This is a quickfix only, it works
thanks to the alignment of internal and XI2 event types.
Eventually, enter/leave events should be wrapped into internal events.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
A client that grabs for button/key events may not have the
ButtonPress/KeyPress mask set and should not receive an event in that case.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
Keysym grabs are tricky in the details, keycode grabs are known to work. So
for now, provide keycode grabs only.
Requires inputproto 1.9.99.15.
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>
|
|
Previously, an active grab on an attached slave device would send the device
floating for the duration of the grab. This breaks existing XI applications
(e.g. the GIMP) since they grab all devices automatically - resulting in the
loss of control over the VCP.
The behaviour of extended input devices during a grab in relation to the
core pointer is not specified in the XI protocol specification.
The removal of the temporary detachment restores the behaviour of extended
input devices as present in currently released servers - even if a device is
grabbed, an event from this device will result in an event from the core
pointer.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
Presumably, some intelligent, XI2-aware management app will be calling
XISetClientPointer on behalf of other clients; this check makes sure
the target client has permission on the device.
Requires changing the prototype to return status code instead of Bool.
Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov>
Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
It's obsolete, not likely to come back, let's drop it.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
event->type is always GenericEvent for XI2 events. Instead, XI_ButtonPress
(the generic event's evtype must be stored.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
GetMaster is more reliable than GetPairedDevice, it always returns the
keyboard/pointer if desired, even if the wrong device was passed in.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
Let EventToXI, EventToCore and EventToXI2 return BadMatch if there's no
matching event for this protocol spec.
Adjust the delivery paths to cope with BadMatch errors (and clean them up on
the way).
As a side-effect, this fixes server crashes on proximity events for a
grabbed device.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
For proximity events, the XI2 type is 0 and inputMasks never got set in the
preceding condition. As a result, proximity events got never delivered.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
These grabs are suported through two fake devices inputInfo.all_devices and
inputInfo.all_master_devices. These devices are not part of the device list
and are only initialised for their device id, nothing else.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
A passive XI2 grab always uses the paired master device as a modifier
device. After issuing a passive grab, the slave may be reattached to a
different master and hence the modifier device may change.
|
|
Exception - implicit passive grabs.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
Rework addresses two issues:
- storing the master device's pointer is a bad idea, we need to store the ID
of the device in case it disappears during the grab.
- restoring the old master did not actually reattach the device. Fixed now.
|
|
grab->type is the device type and XI2 types overlap with core events (being
less than GenericEvent). Thus, for passive grabs the grab device would be
overwritten with whatever device was activating it.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
If we already have an active grab on the device, don't attempt to activate
another one.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
This fixes XI2 enter/leave events being sent to non-xi2 clients.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
Extension devices have ActivateKeyboardGrab as their grab activation
function, hence we need to ensure the implicit passive grab flag is set
accordingly in the grab for further event delivery.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
If an implicit passive grab is active, the XI event mask is in
grab->deviceMask. Otherwise, for explicit grabs, the XI event mask is in
grab->eventMask.
Reported-by: Thomas Jaeger
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
If the XI2 type is 0 (e.g. proximity events), inputMasks is never set and
may not be NULL.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
Conflicts:
Xext/geext.c
Xi/chdevcur.c
Xi/extgrbdev.c
Xi/xiproperty.c
configure.ac
dix/ptrveloc.c
hw/xfree86/common/xf86Config.c
mi/mipointer.h
test/input.c
xkb/xkb.c
|
|
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>
|
|
root_x/y are already in FP1616 at this point.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
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>
|
|
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).
|
|
Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov>
|
|
Add a proper access mode, and reverse the logic of the return value.
Zero ("Success") is returned on success from the hook calls.
Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov>
|