Commit Graph

3874 Commits

Author SHA1 Message Date
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
9aadde3779 mi: don't call UndisplayCursor for non-sprite-owners.
Segfaults are bad.
2007-10-17 12:05:50 +09:30
Peter Hutterer
8b7c4249d8 mi: call processInputProc for master devices after slave event processing.
More work is needed to sort out grabs though.
2007-10-17 10:41:58 +09:30
Peter Hutterer
ae9fc10ade Xi: don't send core events for slave devices. 2007-10-17 10:41:04 +09:30
Peter Hutterer
de70cfdbe6 mi: fix some macros to allow multiple cursors for master devices.
Macros defaulted to inputInfo.pointe rfor devices that weren't spriteOwners.
Changed to take the device's master device now.

This includes sticking in a number of checks and warnings that cursor
rendering won't be called for floating devices.
2007-10-17 09:52:30 +09:30
Peter Hutterer
1d9ebbac8c dix: Make InitCoreDevices use AllocMasterDevice.
Also change naming a bit, append "pointer" and "keyboard" to master devices
instead of -ptr and -keybd.
2007-10-16 18:46:12 +09:30
Peter Hutterer
299573f461 dix: add AllocMasterDevice for creation of new master devices.
Devices are initiated pretty much the same as the core devices.
2007-10-16 18:40:15 +09:30
Peter Hutterer
5fe9bfd23f xfree86: NIDR: don't call PairDevices explicitly.
set isMaster to FALSE explicitly.

Pairing isn't necessary, attachment should be done in EnableDevices.
2007-10-16 18:23:48 +09:30
Peter Hutterer
5eb033835e mi: don't exclude inputInfo.pointer from rendering. 2007-10-16 18:03:52 +09:30
Peter Hutterer
b697c4ed14 dix: CheckPassiveGrabOnWindow: only get paired device for non-keyboards. 2007-10-16 17:47:06 +09:30
Peter Hutterer
caa69d8f7b dix: fix detritus from adding lastSlave field. 2007-10-16 17:38:13 +09:30
Peter Hutterer
90d077e537 dix: GetPointerEvents: get state from master device before applying valuators.
We need to get lastx/y from the master device before we start applying
acceleration etc. Otherwise we get jumping cursors, which is reasonably bad.
2007-10-16 17:37:33 +09:30
Peter Hutterer
b6ccf721b0 include: add "lastSlave" field to DeviceIntRec.
Set to the last slave device that routed events through the master.
2007-10-16 17:35:06 +09:30
Peter Hutterer
e6bd8ae060 dix: set the device's sprite when using AttachDevice
Sprite is set to the master device's sprite.
2007-10-16 15:59:30 +09:30
Peter Hutterer
271d4c3d62 xfree86: remove XI86_SHARED_POINTER flag.
Not needed anymore. By default, all devices are slaves of first master device.
2007-10-16 15:50:07 +09:30
Peter Hutterer
c7b878b904 dix: don't treat VCK/VCP separately in DevHasCursor, IsPointer/KeyboardDevice. 2007-10-16 15:07:31 +09:30
Peter Hutterer
e9f149fb56 Fix up detritus from removing GetPairedPointer/Keyboard. 2007-10-16 14:24:20 +09:30
Peter Hutterer
840bde3d32 dix: GetPairedDevice: return dev paired with master for slave devices. 2007-10-16 13:09:35 +09:30
Peter Hutterer
6c259a08d9 include: remove unused GetPairedPointer/Keyboard declarations. 2007-10-16 13:09:19 +09:30
Peter Hutterer
9ecbbf198f dix: adjust PickPointer and PickKeyboard to get the first master device.
Simplifies it a lot, since we always have at least one master device
available at all times, so less mucking around.
2007-10-16 12:05:09 +09:30
Peter Hutterer
0c5f65ecd3 dix: don't allow slave devices as ClientPointer 2007-10-16 12:04:56 +09:30
Peter Hutterer
9ccc9ab6f2 dix: don't call CloseDevice on VCP/VCK separately. 2007-10-16 12:04:48 +09:30
Peter Hutterer
e4fd981b48 dix: check for isMaster before calling DeviceCursorCleanup. 2007-10-16 12:04:40 +09:30
Peter Hutterer
7503d13407 dix: don't check VCK and VCP separately when looking for device ids.
Both are part of the device list again, so we cover them there.
2007-10-16 12:04:30 +09:30
Peter Hutterer
032e906711 dix: Remove GetPairedPointer, GetPairedKeyboard in favour of GetPairedDevice. 2007-10-16 11:57:42 +09:30
Peter Hutterer
3e07e73fef dix: remove pairing/attachment from InitAndStartDevices.
If we enabled in the correct order, this has all been done already.
2007-10-16 11:34:29 +09:30
Peter Hutterer
38baac71bd dix: Set bidirectional pairing, don't allow pairing with already paired devs. 2007-10-16 11:30:59 +09:30
Peter Hutterer
70efd3d06a dix: fix up Activate/Enable/Disable device.
Set isMaster for VCP/VCK.
Init sprites for master pointer devices.
Pair master kbds with master pointers (1:1 pairing!).
Attach other devices to VCP/VCK.
2007-10-16 11:30:32 +09:30
Peter Hutterer
204f2dc89e include: add "isMaster" field to DeviceIntRec.
Set to TRUE for master devices.

Also fixing up comment for paired field in spriteInfo, will be set
bidirectional from now on.
2007-10-16 11:19:09 +09:30
Peter Hutterer
bd7d5255ce dix: add AttachDevice, needed to attach a slave device to a master device.
For now, we don't allow attaching slaves to other slaves, and we don't allow
pairing slaves with other slaves.
Pairing is for master keyboard->master pointer only.
Attaching is for slave device->master device only.
2007-10-16 11:18:31 +09:30
Peter Hutterer
be1565f6b8 dix: Set core devices to ProcessOtherEvents, set sendCore and XKB.
Even the virtual core devices should send through ProcessOtherEvents.
2007-10-16 11:05:34 +09:30
Peter Hutterer
ce9bf9a191 include: add "master" field to DeviceIntRec.
"master" points to the device this device is attached to. Event sent by the
device will also be routed through the master.
master and spriteOwner are mutually exclusive.
2007-10-16 11:05:23 +09:30
Peter Hutterer
042e16458b dix: change a few inputInfo.keyboard over to PickKeyboard() 2007-10-09 23:07:51 +09:30
Peter Hutterer
d42909b23a dix: when disabling a device, make sure all paired devices are re-paired.
We re-pair them with the VCP, not a real device! If we would do otherwise,
somebody may change our keyboard focus and thus get us typing where we don't
want to type.
2007-10-05 13:04:10 +09:30
Peter Hutterer
ff2351246d dix: When pairing, only check for access right if client is set.
If the pairing client is not set, then the pairing is initiated internally
(e.g. when a new keyboard device is configured). In this case we _must_ pair
regardless of who is the pairing client.
2007-10-05 12:19:40 +09:30
Peter Hutterer
ab88cb8d2e Xext: add missing geint.h to Makefile.am (un-breaks make dist) 2007-10-03 18:08:33 +09:30
Peter Hutterer
9f2b493e34 xkb: remove some warning comments.
Obsolete with 340911d724.
2007-10-03 15:22:09 +09:30
Peter Hutterer
1eebb03a31 dix: ignore passive grab if the client already has a grab on the device.
In some cases a button press may activate a passive core grab. If the client
owning the passive grab already has a core grab on another device, don't
actually activate it. Otherwise the client gets two simultaneous passive
core grabs, and may never ungrab the device again (only if the other grab uses
GrabModeSync).

Reproducable: fire up gnome-session, open up gnome-terminal. Click with the
ClientPointer onto the window decoration, then click with another pointer onto
an application icon in the panel. Drag the icon out, release the button and
voila - you just lost your second mouse.
2007-10-03 15:18:17 +09:30
Peter Hutterer
0b48506782 dix: send NotifyGrab/NotifyUngrab focus events regardless of semaphore state.
This is just papering over a problem. The whole focus system needs to be
revised.
2007-10-03 14:22:55 +09:30
Peter Hutterer
05106ac983 dix: change Enter/Leave semaphore handling to accommodate for NotifyGrab.
This is a half-assed attempt at getting rid of some enter-leave problems. When
a grab is activated, the events didn't get sent before, leading to interesting
results. This commit papers over it but doesn't actually fix it properly. The
whole enter/leave (focusin/out) structure needs to be ripped out and changed
for multiple devices.
2007-10-03 11:33:10 +09:30
Peter Hutterer
f965a5f345 dix: Ignore devices when deleting passive core grabs. 2007-10-02 16:20:27 +09:30
Peter Hutterer
2b075e97ec mi: switch core keyboard on XI events, not only on core events.
We only get core events through the EQ in exceptional cases, so make sure we
actually swap the core keymap for XI events as well. Gives us back the ability
to have multiple keyboard layouts simultaneously.
2007-10-02 13:28:40 +09:30
Peter Hutterer
45ec6cd1fb xfree86: fix DGA to use the correct devices.
DGAStealXXXEvent modified to take in device argument.

The evdev driver only sends one valuator when only one axis changed. We need
to check for DGA either way (xf86PostMotionEventP), otherwise we lose purely
horizontal/vertical movements.

Note that DGA does not do XI events.
2007-10-02 13:19:07 +09:30
Peter Hutterer
122ae65ed9 xfree86: xf86DGA: some cleanup to use the correct devices instead of VCP/VCK. 2007-10-02 10:50:59 +09:30
Peter Hutterer
54ce7436b2 xfree86: update all pointers when calling xf86SwitchMode
Center the frame around the first pointer found and then update all pointers
on the same screen to move to the edges (if necessary).

Note: xf86WarpCursor needs to be modified, is using deprecated
miPointerWarpCursor and will kill the server when called with
inputInfo.pointer.
2007-10-02 10:49:46 +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
Peter Hutterer
be466d8df8 dix: GetPairedKeyboard() always returns a valid keyboard (VCK if necessary).
We need it unconditionally in a few places, and the rest checked for NULL and
then set it to VCK anyway. So, fixing up all callers to appreciate the defined
return value.
2007-09-28 09:28:39 +09:30
Peter Hutterer
53434edc3d dix: take paired keyboard instead of VCK (CoreProcessPointerEvents) 2007-09-28 09:28:28 +09:30