Commit Graph

122 Commits

Author SHA1 Message Date
Peter Hutterer
a05f43bf3e dix: When the last slave is removed, set master to the original classes.
DeviceClassesChangedEvent is sent to the client, where device == new slave.
2007-11-12 11:35:18 +10:30
Peter Hutterer
7a81bafc9b Xi, dix: Add ability to change MD classes + send event when doing so.
Each time a different slave device sends through a master, an
DeviceClassesChangedEvent is enqueued. When this event is processed, all
classes of the matching master device are changed, and the event is sent to
the clients.

Next time the master is queried, it thus shows the evclasses of the last slave
device. The original classes are stored in the devPrivates.

TODO: if all slave devices are removed, the master's original classes need to
be restored.
2007-11-09 23:10:24 +10:30
Peter Hutterer
676b26ca3e Xi: notify the clients when the device hierarchy has been changed. 2007-11-09 14:31:54 +10:30
Peter Hutterer
180220f284 Xi: return BadDevice for slave devices on ProcXSetClientPointer
Also clean up to return error codes instead of sending the error manually.
2007-11-08 10:00:35 +10:30
Peter Hutterer
184a7b8917 Merge branch 'mpx' into mdsd
Conflicts:

	Xi/opendev.c
2007-11-08 09:34:35 +10:30
Peter Hutterer
0b729051c0 Merge branch 'master' into mpx
Conflicts:

	Xi/extinit.c
	Xi/grabdev.c
	Xi/setmode.c
	Xi/ungrdev.c
	dix/devices.c
	dix/events.c
	dix/getevents.c
	include/dix.h
	mi/midispcur.c
	mi/misprite.c
	xkb/xkbActions.c
	xkb/xkbEvents.c
	xkb/xkbPrKeyEv.c
2007-11-07 15:37:23 +10:30
Peter Hutterer
a8808ac3d0 Xi: don't call CheckMotion for slave devices.
This essentially disables enter/leave for slave devices, but re-enables them
for master devices. Which is a good thing after all.
2007-11-07 11:42:58 +10:30
Daniel Stone
fb32bb9839 Xi: Remove usage of alloca
Replace with xalloc/xfree.
2007-11-05 14:34:46 +00:00
Peter Hutterer
d9caa469b9 Xi: allow VCP/VCK to be OpenDevice'd as well.
All devices deserve to be equal. Except master devices, they are a bit more
equal than the others.
2007-10-19 15:26:09 +09:30
Peter Hutterer
155e2c559e Xi: advertise as XInput v2 capable 2007-10-19 14:37:07 +09:30
Peter Hutterer
5ba738935f Xi: remove ChangePointerKeyboardPairing in favour of ChangeDeviceHierarchy. 2007-10-19 14:36:37 +09:30
Peter Hutterer
6dcde0e9c1 Xi: set master device's id in ListDevices Reply. 2007-10-19 11:28:50 +09:30
Peter Hutterer
cfcc6e14b9 Xi: return all master devices as type IsXPointer/Keyboard when listing devs.
Slave devices are reported as IsXExtensionPointer/Keyboard.
2007-10-19 11:28:44 +09:30
Peter Hutterer
ae9fc10ade Xi: don't send core events for slave devices. 2007-10-17 10:41:04 +09:30
Peter Hutterer
e9f149fb56 Fix up detritus from removing GetPairedPointer/Keyboard. 2007-10-16 14:24:20 +09:30
Peter Hutterer
113011221a Xi, xfree86: Remove leftovers of the XI wrapper code. 2007-10-01 21:42:01 +09:30
Peter Hutterer
a511c445de Remove generation of core events, long live XI!
Let the drivers only generate XI events and put those into the event queue.
When processing events, generate core events as needed. This fixes a number of
problems with XKB and the DIX in general.

The previous approach was to put core events and XI events as separate events
into the event queue. When being processed, the server had no knowledge of
them coming from the same device state change. Anything that would then change
the state of the device accordingly was in danger of changing it twice,
leading to some funny (i.e. not funny at all) results.

Emulating core events while processing XI events fixes this, there is only one
path that actually changes the device state now. Although we have to be
careful when replaying events from synced devices, otherwise we may lose
events.

Note: XI has precedence over core for passive grabs, but core events are
delivered to the client first.

This removes the wrapping added in 340911d724
2007-09-28 18:46:41 +09:30
Eamon Walsh
3b114f2603 Input: Properly swap DevicePresenceNotify events. 2007-09-26 07:26:59 -04:00
Eamon Walsh
31a7994ac7 Input: Return errors to the dispatcher instead of sending them ourself.
Also fixed two "unused variable: stuff" warnings.
2007-09-26 07:26:59 -04:00
Peter Hutterer
3342b5ad47 Xi: fix the wrapper code for processInputProc wrapping.
Followup to [1].
If a core grab causes the device to freeze, it overwrites the processInputProc
of the device. [1] would then overwrite this while unwrapping, the device
does not thaw anymore.
Changing this to only re-wrap if the processInputProc hasn't been changed
during the event handling.

[1] 340911d724
2007-09-26 18:03:21 +09:30
Peter Hutterer
55fd50273e Xi: unify ErrorFs. Prefix all with [Xi]. 2007-09-26 15:15:34 +09:30
Peter Hutterer
340911d724 Wrap core event handling through ProcessOtherEvents.
When processing events from the EQ, _always_ call the processInputProc of the
matching device. For XI devices, this proc is wrapped in three layers.
Core event handling is wrapped by XI event handling, which is wrapped by XKB.
A core event now passes through XKB -> XI -> DIX.

This gets rid of a sync'd grab problem: with the previous code, core events
did disappear during a sync'd device grab on account of mieqProcessInputEvents
calling the processInputProc of the VCP/VCK instead of the actual device. This
lead to the event being processed as normal instead of being enqueued for
later replaying.
2007-09-26 15:12:49 +09:30
Daniel Stone
27ad5d74c2 Input: Generate XKB mapping changes for all core-sending devices (bug #12523)
When we change the mapping on a core device, make sure we propagate this
through to XKB for all extended devices as well.
2007-09-23 17:17:20 +03:00
Peter Hutterer
03680a384a dix: don't change the device struct while processing core events.
The device state needs to be changed while processing the XI event. Core
events are always processed after XI, so by then the device is already set up
properly. However, we now rely on DeviceButtonMotionMask to be equal to
ButtonMotionMask. It already is, but stick a big fat warning in so nobody
attempts to change it.

This commit disables XKB for the VCK, thus essentially for all devices.
Temporarily anyway.
2007-09-06 15:43:47 +09:30
Peter Hutterer
f367285fd5 Merge branch 'master' into mpx
Conflicts:

	Xi/exevents.c
	dix/devices.c
	dix/getevents.c
	include/dix.h
	mi/mieq.c
2007-08-12 15:31:10 +09:30
Daniel Stone
cd8e99e56e Input: Don't enable devices when we open them
Thanks to Xi's braindead design, it's otherwise impossible to query input
devices without enabling them.  Hurrah.
2007-08-01 03:33:06 +03:00
Peter Hutterer
9809715afa Change CheckMotion to ignore non-pointer events but acknowledge XI events.
Call CheckMotion from ProcessOtherEvents() to make sure absolute XI events
update the sprite before an event is sent.
2007-07-10 10:09:50 +09:30
Paulo Ricardo Zanoni
c1a6841a64 ProcX{Change|Query}WindowAccess: change device list from char* to XID*. 2007-07-10 10:08:44 +09:30
Peter Hutterer
5ccc09b182 Use the same struct for generic event masks throughout the code.
Renaming those structs too.

Previously grabs were using a different struct than windows, which was
reasonably stupid.
2007-07-06 15:43:08 +09:30
Peter Hutterer
c1a16bdcfe Add 'evfill' field to GEExtensions.
We need this to allow extensions to fill in extra data for an event before it
is sent to the client. This is probably to be used like
FillUpEventsFromWindow().
2007-07-01 09:14:18 +09:30
Peter Hutterer
08779c62ba Reset grab->next to NULL when we're creating a grab.
This is definitely necessary in CheckDeviceGrabAndHintWindow (thanks to Paulo
Zanoni for spotting it). We're resetting it everywhere else too, just to be
save.
2007-06-27 11:58:20 +09:30
Peter Hutterer
8396bf7c8b Init genericMasks to 0, make sure list is NULL terminated. 2007-06-27 11:58:04 +09:30
Peter Hutterer
87564543d9 Only decrement buttonsDown when the button count is greater than 0.
Device drivers flush their buttons on device init and cause a button down
event to be generated. If we unconditionally decrease the buttons, we won't be
able to ever get a passive device grab.

Format documentation for CheckDeviceGrabs to make it readable.
(cherry picked from commit 3e894974cd)

Conflicts:

	Xi/exevents.c
2007-06-25 09:35:30 +09:30
Peter Hutterer
5dee64fc99 Add a few comments to ProcXGrabDevice. 2007-06-19 11:31:22 +09:30
Peter Hutterer
3e894974cd Only decrement buttonsDown when the button count is greater than 0.
Device drivers flush their buttons on device init and cause a button down
event to be generated. If we unconditionally decrease the buttons, we won't be
able to ever get a passive device grab.

Format documentation for CheckDeviceGrabs to make it readable.
2007-06-15 17:16:16 +09:30
Peter Hutterer
26b21157cf Add a deviceMask to the GrabRec and don't interfere with passiveGrabs.
This quickfixes event delivery problems with XI events when a grab was on.
deviceMask is only used when the grab was from a ButtonPress to preserve
potential XI event masks.

This is not an ideal solution but it works until I have time to work on
PassiveGrabs.
2007-05-31 17:05:14 +09:30
Paulo Ricardo Zanoni
b5db863945 Allow value None for windows when setting ClientPointer.
We need this for clients that need to set the ClientPointer but don't have a
window on display yet. If used, it will set the device as the ClientPointer
for the requesting client.
2007-05-30 16:15:15 +09:30
Peter Hutterer
167e1773de Remove unused include "gestr.h" 2007-05-21 10:45:10 +09:30
Peter Hutterer
333bab4b23 Clean up, correct some comments.
Send event type down with the RawEvents.
2007-05-17 17:59:02 +09:30
Peter Hutterer
81fc6a128b Add ungrab support to ExtendedGrabDeviceRequest handling.
Polish the code a bit.
2007-05-14 18:12:56 +09:30
Peter Hutterer
5c680e9493 Remove double-grab option. We only want one grab per device. 2007-05-14 12:34:53 +09:30
Peter Hutterer
4dc973f08c Add ExtendedGrabDevice handling.
Add XGE handling in DeliverGrabbedEvent.

We can now grab something selecting XGE events, but the current code is a
bit messy and doesn't work too well yet.
2007-05-14 10:42:03 +09:30
Peter Hutterer
c03d9a7217 Cleaning up a bit.
Register correct event in EventSwapVector.
Fix up event swap for GE events, register XI's swap function at GE.
2007-05-02 18:16:40 +09:30
Peter Hutterer
e6fd4a24eb Add handling for FakeDeviceEvent request.
Fix a stupid bug from last commit, mask names were wrong.
2007-05-02 17:49:20 +09:30
Peter Hutterer
af25720598 Add missing files for ProcXiSelectEvent.
Should have been a part of 5e43910929. Oh well.
2007-05-02 13:51:16 +09:30
Peter Hutterer
58c0fd2927 Adjust EQ to support long events.
Add RawDeviceEvent (pointers only for now).

This commit changes the event queue to use EventLists instead of xEvent
arrays. Only EQ is affected, event delivery still uses xEvent* (look for
comment in mieqProcessInputEvent).

RawDeviceEvents deliver driver information to the client, without clipping or
acceleration.
2007-05-02 13:50:09 +09:30
Peter Hutterer
8b42ba64e1 Send PointerKeyboardPairingChangedNotifyEvent using XGE.
Needs updated inputproto and libXi.
2007-05-01 12:12:58 +09:30
Paulo Ricardo Zanoni
82f97e1c0c Enable event delivery for multiple heads.
Requires moving the spriteTrace into the DeviceIntRec and adjusting a few
functions to take in device argument, most notably XYToWindow().

Cursor rendering on the second screen is busted.
2007-04-26 15:58:50 +09:30
Peter Hutterer
d4dad6f84f Merge branch 'master' into mpx
Conflicts:

	configure.ac
	dix/events.c
	hw/xfree86/common/xf86Xinput.c
2007-04-12 11:11:03 +09:30
Remigiusz Marcinkiewicz
aecbc71214 Input: Allow a pointer to a device to be returned in NIDR
Allow a pointer to the first device added to be returned, so we know which
device(s) were added by the NIDR call.
2007-04-11 00:38:16 +03:00