Commit Graph

1261 Commits

Author SHA1 Message Date
Peter Hutterer
f00cf76751 dix: get the current MD keyboard for the grab modifier state.
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.
2009-06-02 16:02:31 +10:00
Peter Hutterer
1cd7ed75d9 dix: float slave devices during passive grabs.
Exception - implicit passive grabs.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-06-02 16:02:29 +10:00
Peter Hutterer
f56ad22e8f dix: rework temporary slave detachment.
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.
2009-06-02 15:53:21 +10:00
Peter Hutterer
b3e4810a28 dix: move grab device assignment into GRABTYPE_CORE block.
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>
2009-06-02 10:41:10 +10:00
Peter Hutterer
18ae486708 dix: don't try to activate a passive grab on top of an active one.
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>
2009-06-02 10:41:10 +10:00
Peter Hutterer
ff1d6244eb input: add support for XIAnyModifier in passive XI2 grabs. 2009-06-02 10:40:59 +10:00
Peter Hutterer
80ea32ad4f dix: switch grab checking from unsigned shorts to unsigned ints
XIAnyModifier is outside of the unsigned short range.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-06-01 13:48:43 +10:00
Peter Hutterer
080b0331b3 input: Add grabtype to GrabParameters.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-06-01 13:48:43 +10:00
Peter Hutterer
bee02a1541 dix: ensure implicit passive grabs have the xi2mask zeroed.
This fixes XI2 enter/leave events being sent to non-xi2 clients.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-06-01 13:45:30 +10:00
Peter Hutterer
0f47203a9a dix: Set the implicit passive grab flag for keyboards too.
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>
2009-05-29 14:19:35 +10:00
Peter Hutterer
75c73ddbfc dix: fix broken XI event delivery during grabs.
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>
2009-05-29 14:02:39 +10:00
Peter Hutterer
235cf5713a dix: init inputMasks to NULL to avoid random value dereference.
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>
2009-05-29 12:10:48 +10:00
Peter Hutterer
68d86adbe8 dix: GetProximityEvents doesn't need extra events for valuators.
With internal events, we only have one event for all the data, no need to
calculate for extra events.

Reported-by: Thomas Jaeger
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-05-29 12:03:41 +10:00
Peter Hutterer
d7aef3f663 Merge branch 'master' into xi2
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
2009-05-28 17:20:58 +10:00
Peter Hutterer
a25f248fc3 Xi: Send Enter or Leave events with XIPassive(Un)grabNotify
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>
2009-05-28 15:02:35 +10:00
Peter Hutterer
a7e23a79c1 Xi: Add support for Enter and FocusIn grabs.
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>
2009-05-27 14:40:58 +10:00
Peter Hutterer
bedfd561fa dix: fix wrong cast of eventMask into CreateGrab. 2009-05-27 13:54:19 +10:00
Peter Hutterer
b3463fd6a8 dix: convert window coordinates to FP1616 before calculating event_x/y
root_x/y are already in FP1616 at this point.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-05-27 13:54:19 +10:00
Peter Hutterer
10b5e98101 dix: take grabs into account for XI_Enter/Leave events. 2009-05-27 13:54:18 +10:00
Peter Hutterer
9dc3810a03 dix: set the right grab event type for implicit passive grabs.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-05-27 13:54:18 +10:00
Nicolai Hähnle
6583477035 Remove reference to non-existing requestLog and requestLogIndex
These fields were removed in 252ec50481.

Signed-off-by: Nicolai Haehnle <nhaehnle@gmail.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-05-27 10:04:28 +10:00
Peter Hutterer
da0d3baf71 dix: protect event generation against single-valuator devices.
If we have a single-axis device and it sends events it should not access
non-existant memory.
2009-05-22 15:44:57 +10:00
Peter Hutterer
c9df51b070 input: allow for master pointers to not have a button class.
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>
2009-05-22 15:44:57 +10:00
Peter Hutterer
ebe45e1a72 input: introduce partial class copying depending on the event.
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>
2009-05-22 15:44:57 +10:00
Peter Hutterer
bc63c8a457 dix: introduce GetMaster()
For hybrid devices (keys + buttons/axes) the attached master device is
generally the wrong one. One shouldn't post a button event through a
keyboard and vice versa.

GetMaster(dev) returns the right master device for the given type needed.
This may be the MD paired with this device's MD.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-05-22 15:44:57 +10:00
Peter Hutterer
d79318f269 dix: Add a deviceid to the DeviceChangedEvent.
ChangeDeviceId would actually overwrite the flags field if deviceid wasn't
present. Aside from the event of course not telling which device generated
it in the first place.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-05-22 15:44:57 +10:00
Peter Hutterer
438a4eafa5 input: remove nested union from InternalEvent.
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>
2009-05-22 15:44:56 +10:00
Peter Hutterer
b12d302df8 Input: rename DeviceIntRec->isMaster to ->type.
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).
2009-05-22 15:44:50 +10:00
Peter Hutterer
add2defac7 Split the signal-handler's lastSlave out into a separate variable.
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>
2009-05-22 15:44:03 +10:00
Peter Hutterer
7db55a0806 dix: remove superfluous loop in change_modmap.
A device can only be attached to a single master device. So instead of
looping and searching for the master device, we can just use dev->u.master
directly.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-05-22 12:24:21 +10:00
Peter Hutterer
73c7398aaf dix: 'namespace' HAS_OLD_SLAVE and HAS_NEW_SLAVE.
We need more flags for this in the near future, so let's namespace them now.
2009-05-21 11:59:17 +10:00
Peter Hutterer
c2785ae7eb dix: refuse events from disabled devices.
If the device is disabled ("off"), it must not send events to a client.
The driver shouldn't send events in that case anyway, but just to make sure
we simply drop events coming while the device is disabled.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-05-20 16:22:24 +10:00
Peter Hutterer
7b891e450f dix: Remove obsolete comment
CorePointerProc doesn't back up the device classes anymore.
2009-05-20 16:22:24 +10:00
Peter Hutterer
42719ce5c7 dix: remove superfluous loop in change_modmap.
A device can only be attached to a single master device. So instead of
looping and searching for the master device, we can just use dev->u.master
directly.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-05-20 16:22:24 +10:00
Eamon Walsh
77e90261d5 dix/events.c: Use wClient where appropriate.
Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov>
2009-05-19 19:36:03 -04:00
Eamon Walsh
3cea176d5a xace: Fix a bad device access hook call.
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>
2009-05-19 19:35:46 -04:00
Peter Hutterer
5c3e728980 dix: count must be 1 if we have an XI2 match.
This fixes events that activated a grab not getting delivered to the client.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-05-16 12:20:59 +10:00
Peter Hutterer
8ff1bff8f4 Update to new XI2 names 2009-05-16 12:20:58 +10:00
Peter Hutterer
273890924b input: reduce the number of superfluous hierarchy events
There's only two reasons for hierarchy events:
- device is added, removed, etc. In this case we want to send the event as
  it happens.
- devices are added in a XIChangeDeviceHierarchy request. In this case we
  only want one event cumulating all changes.
2009-05-16 12:20:58 +10:00
Peter Hutterer
033a2b12fc Xi: set per-device hierarchy changed flags.
Rather than have one field per hierarchy change, XI2 has two fields - one
generic one and one per-device that include the device-specific flags.
This requires some funky handling for removed devices, but oh well.
2009-05-16 12:20:58 +10:00
Peter Hutterer
fdce58ca82 dix: ensure Activate/DeactivateGrab has a valid value.
Xephyr doesn't manually set Activate/DeactivateGrab for new devices,
resulting in a NULL-pointer dereference later when a grab is activated.
Avoid the segfault by ensuring that the pointer is always valid.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-05-16 12:20:58 +10:00
Peter Hutterer
6f9e220498 dix: ensure Activate/DeactivateGrab has a valid value.
Xephyr doesn't manually set Activate/DeactivateGrab for new devices,
resulting in a NULL-pointer dereference later when a grab is activated.
Avoid the segfault by ensuring that the pointer is always valid.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-05-16 12:01:22 +10:00
Adam Jackson
c66cf7b64c Update several of my and/or Red Hat's licenses to standard form. 2009-05-14 07:02:44 -04:00
Alan Coopersmith
b680bda34d Fix a couple off-by-one array boundary checks.
Error: Write outside array bounds at Xext/geext.c:406
        in function 'GEWindowSetMask' [Symbolic analysis]
       In array dereference of cli->nextSib[extension] with index 'extension'
       Array size is 128 elements (of 4 bytes each), index <= 128

Error: Buffer overflow at dix/events.c:592
	in function 'SetMaskForEvent' [Symbolic analysis]
       In array dereference of filters[deviceid] with index 'deviceid'
       Array size is 20 elements (of 512 bytes each), index >= 0 and index <= 20

Error: Read buffer overflow at hw/xfree86/loader/loader.c:226
	in function 'LoaderOpen' [Symbolic analysis]
       In array dereference of refCount[new_handle] with index 'new_handle'
       Array size is 256 elements (of 4 bytes each), index >= 1 and index <= 256

These bugs were found using the Parfait source code analysis tool.
For more information see http://research.sun.com/projects/parfait

Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-05-08 12:27:11 -07:00
Peter Hutterer
00bc043fa0 dix: export subpixel precision in XI2 events for root/event coordinates.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-05-08 14:33:50 +10:00
Peter Hutterer
bae070914f input: update to inputproto 1.9.99.8 XI2 defines.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-05-08 14:33:44 +10:00
Simon Thum
9457ce4489 dix: remove superfluous includes from ptrveloc.c
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-05-08 14:33:22 +10:00
Simon Thum
ee30e1b102 dix: fix warning in pointer acceleration
newer gcc's warn against how this cast is done (though it eludes me why),
and lrintf() is also faster especially on insane processors like the P4
(http://www.mega-nerd.com/FPcast).

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-05-08 14:33:22 +10:00
Simon Thum
3fc6fcfb26 dix: add 'none' pointer acceleration profile with number -1
This is a shorthand for disabling acceleration, while retaining the
possiblity to use constant deceleration. If constant deceleration is
also unused, it will optimize motion processing.

Other possiblities to deactivate acceleration were quite hidden,
and didn't always work as expected. E.g. xset m 1 1 would retain
adaptive deceleration, while xset m 1 0 would not (in the default
profile).

Also removes the 'reserved' profile; it was unused and it's trivial
to add new ones anyway.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-05-07 16:49:06 +10:00
Simon Thum
9d1597cbef dix: remove superfluous includes from ptrveloc.c
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-05-07 16:49:04 +10:00
Simon Thum
35fce4e5c7 dix: fix warning in pointer acceleration
newer gcc's warn against how this cast is done (though it eludes me why),
and lrintf() is also faster especially on insane processors like the P4
(http://www.mega-nerd.com/FPcast).

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-05-07 16:49:02 +10:00
Peter Hutterer
d220d6907d Xi: add GrabButton and GrabKeysym code.
We don't do keycode grabs in XI2, they're pointless.
2009-05-06 14:37:33 +10:00
Peter Hutterer
59358de4b6 input: ensure various ProcUngrabKey/Buttons have the right grabtype set. 2009-05-04 17:40:29 +10:00
Peter Hutterer
834ea071b6 dix: if grab types differ, two grabs cannot be the same. 2009-05-04 17:40:25 +10:00
Peter Hutterer
08cd846000 dix: only free the old cursor if the grab was successful.
Testcase: start thunderbird and move a message around, crashes after two or
three moves.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-05-04 15:21:38 +10:00
Peter Hutterer
6a618929a0 input: reshuffle CreateGrab and friends to take a GrabParameters param.
This is cleaning up work in preparation for XI2 passive grabs.
2009-05-01 09:07:37 +10:00
Eamon Walsh
57aff88c7d Fix most remaining deprecated resource lookups.
Callsites updated to use dixLookupResourceBy{Type,Class}.
TODO: Audit access modes to make sure they reflect the usage.
2009-04-29 01:04:37 -04:00
Peter Hutterer
c2c515ead3 dix: remove all but main() from main.c
All other functions are pushed into where they seemed to fit.
main.c is now linked separately into libmain.a and linked in by the various
DDXs.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-04-28 16:03:56 +10:00
Peter Hutterer
987579c930 dix: remove all but main() from main.c
All other functions are pushed into where they seemed to fit.
main.c is now linked separately into libmain.a and linked in by the various
DDXs.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-04-28 15:57:14 +10:00
Peter Hutterer
057fc9a4f8 Merge branch 'master' into xi2
Conflicts:
	Xi/chdevhier.c
	include/input.h
2009-04-24 16:15:47 +10:00
Benjamin Close
fab563bf8f input: propagate XTst events through virtual slave devices.
A XTest virtual slave device pair (kbd/ptr) exists for every master
device pair. This is so XTest events are correctly propogated via slave
devices up to Master devices and the classes are correctly changed along
the way. We add the XTest slave device pair to the Virtual Core pointer
and provide a simple way of creating the devices.

A XTest Slave Device is identified by the XTstDevicePrivateKey property
being set in the devices devProperties

XI events are still propagated through the matching device, in the hope the
client knows what it is doing.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-04-24 15:28:33 +10:00
Benjamin Close
826a5bff01 dix: Change AllocMaster into AllocDevicePair, allow creation of SDs too.
Allocating a slave device is essentially the same as allocating a master device.
Hence we rename AllocMaster to AllocDevicePair and provided the ability to
indicate if a master or slave device pair is required.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-04-21 13:11:51 +10:00
Peter Hutterer
e2e5932bda dix: don't allow more than MAX_VALUATORS on one device.
Some keyboards (?) advertise more than MAX_VALUATORS axes. Parts of the
internal event delivery relies on not having more than MAX_VALUATOR axes, so
let's cap it down.
If there's real devices that require more than the current 36, I'm sure we can
bump this up.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-04-21 13:11:51 +10:00
Julien Cristau
063833f3a6 Add XI 1.5 event and requests to protocol.txt 2009-04-20 12:50:34 +02:00
Julien Cristau
4f86ee61a4 Add RandR 1.3 requests to protocol.txt 2009-04-20 12:50:29 +02:00
Peter Hutterer
d5ad14c8ed Merge branch 'master' into xi2 2009-04-19 22:28:22 +10:00
Peter Hutterer
54716fd3db Convert to using int32_t fixed point values on the wire.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-04-19 22:28:12 +10:00
Peter Hutterer
129ac9a914 dix: set root_x/y for device events.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-04-19 22:28:12 +10:00
Peter Hutterer
74d0fc3aee dix: don't allow more than MAX_VALUATORS on one device.
Some keyboards (?) advertise more than MAX_VALUATORS axes. Parts of the
internal event delivery relies on not having more than MAX_VALUATOR axes, so
let's cap it down.
If there's real devices that require more than the current 36, I'm sure we can
bump this up.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-04-19 22:28:11 +10:00
Peter Hutterer
edb70caf21 dix: remove un-used parameter "core" from AllowSome
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-04-19 22:28:11 +10:00
Peter Hutterer
c94ea5bc05 input: use a GrabMask union in GrabDevice to allow for XI2 masks.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-04-19 22:28:11 +10:00
Peter Hutterer
09f9a86077 input: replace GrabRec's coreGrab field with grabtype.
Don't allow grabs of different types to override each other.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-04-19 22:28:08 +10:00
Simon Thum
cbbc7fed99 dix: correctly utilize tracker buffer and protect from timer overruns
two small related fixes hard to split up

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-04-19 22:19:00 +10:00
Peter Hutterer
8bf2f56267 dix: fix dev/keybd variable mixup.
Reported-by: Eric Anhold <eric@anholt.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-04-19 22:18:05 +10:00
Simon Thum
73b01a9aac dix: fix pointer accelerations remainder handling
This didn't really work as intended, but did amazingly well thanks
to roundf() hiding the defect. Cheers!

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-04-19 22:17:48 +10:00
Peter Hutterer
4318075140 dix: store subpixel precision and send it down the wire to the client.
For the valuator data, not yet for root x/y and event x/y.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-04-19 22:17:07 +10:00
Simon Thum
9212948461 dix: allow relative motion buffer to accumulate in a natural way
Since with XI2 we pass sub-pixel motion, anything else is broken.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-04-19 22:16:49 +10:00
Peter Hutterer
b406886bbf input: allow NULL as XkbRMVLOSet in InitKeyboardDeviceStruct.
Virtually all callers use
    XkbGetRulesDefault(&rmlvo);
    InitKeyboardDeviceStruct(..., rmlvo);

Let's save them the trouble and accept NULL as a hint to take the
default RMLVO.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Benjamin Close <Benjamin.Close@clearchain.com>
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2009-04-17 10:03:40 +10:00
Peter Hutterer
4e4e263bc0 dix: remove un-used parameter "core" from AllowSome
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-04-17 10:03:30 +10:00
Eric Anholt
4474c200a1 Move VENDOR_* defines from AC_SUBST to a header to avoid angering shave.
This is more sane anyway, as it ensures a rebuild when changing them.
2009-04-14 10:35:44 -04:00
Simon Thum
ff7f019bbc dix: correctly utilize tracker buffer and protect from timer overruns
two small related fixes hard to split up

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-04-10 13:49:51 +10:00
Simon Thum
06aebecb19 dix: fix pointer accelerations remainder handling
This didn't really work as intended, but did amazingly well thanks
to roundf() hiding the defect. Cheers!

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-04-10 13:49:51 +10:00
Peter Hutterer
011cee3103 dix: fix dev/keybd variable mixup.
Reported-by: Eric Anhold <eric@anholt.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-04-09 20:50:32 +10:00
Peter Hutterer
6c3b633299 Merge branch 'master' into xi2 2009-04-07 19:36:27 +10:00
Peter Hutterer
0cfd481308 dix: Dont change the keyboard mapping on non-keyboard devices.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-04-07 19:25:17 +10:00
Adam Jackson
6574ab092f DPMS: Remove the defaultDPMS* variables 2009-04-03 18:22:20 -04:00
Adam Jackson
c1cf36ee29 DPMS: Simplify command line parsing 2009-04-03 18:22:20 -04:00
Adam Jackson
d52fddefae DPMS: Align the default timeouts with the default screensaver timeout.
On a typical LCD, a black screensaver is actually worse for power
consumption than a normal screen, because it takes more energy to turn
the crystals opaque.  Also, the intermediate DPMS states are essentially
useless and most monitors alias them to the 'off' state, so we may as
well do the same.

As a pleasant side effect, this brings the default DPMS timeouts in line
with the EnergyStar Program Requirements for Computers:

http://www.energystar.gov/index.cfm?c=revisions.computer_spec

which state that products must be "shipped with the display's Sleep mode
set to activate within 15 minutes of user inactivity".
2009-04-03 18:22:20 -04:00
Adam Jackson
38576dc3ae DPMS: Simplify some macro silliness. 2009-04-03 18:22:19 -04:00
Adam Jackson
2e145989d1 dix: Simplify InitClient() 2009-03-31 15:00:27 -04:00
Peter Hutterer
e3c1096273 dix: build_modmap_from_modkeymap needs to bounds-check its argument.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2009-03-27 11:26:15 +10:00
Peter Hutterer
45baef0b77 dix: return BadValue as error in SetModifierMapping.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2009-03-27 11:26:15 +10:00
Peter Hutterer
844bb629fe dix: remove a truly useless a = (foo) ? bar : bar; statement.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-03-23 16:06:53 +10:00
Tomas Carnecky
62183a06e5 Remove two unused defines in C files
These two defines were defined in C files but not used anywhere:

  dix/window.c      #define DeviceEventMasks (KeyPressMask | [...]
  os/connection.c   #define MAXFD 500

Signed-off-by: Tomas Carnecky <tom@dbservice.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-03-23 16:06:34 +10:00
Peter Hutterer
111ef10375 dix: move ProcGrabPointer guts into GrabDevice.
Yes, this means we have even more arguments to GrabDevice. But it beats having
a copy of most but not all of GrabDevice in ProcGrabPointer.
Also, reshuffle the order of parameters, the CARD* status is a return value
and should be last.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-03-20 15:17:57 +10:00
Peter Hutterer
15a969c0fc dix: remove now obsolete mskidx parameter from DeliverEventsToWindow.
mskidx would always be dev->id anyway, so if we're already passing in the
device, mskidx is superfluous.
2009-03-20 15:17:57 +10:00
Peter Hutterer
46145a9312 dix: remove coreMods field from GrabRec.
Nobody uses it anyway, and it's taking up a whole bit!
2009-03-20 15:17:56 +10:00
Peter Hutterer
d9b7343eac dix: even if we don't get a XI1 event, continue processing. 2009-03-20 15:17:56 +10:00
Peter Hutterer
e11dc10f01 dix: Send HierarchyEvents when devices are added/removed/enabled/disabled. 2009-03-20 15:17:56 +10:00
Peter Hutterer
8634e1bcba dix: send presence events when floating and unfloating SDs 2009-03-20 15:17:56 +10:00
Peter Hutterer
a4b61cfc78 dix: un-static FixUpEventFromWindow and deal with focus events too. 2009-03-20 15:17:56 +10:00
Peter Hutterer
4cc6a96d71 input: add support for RawDeviceEvents. 2009-03-20 15:17:56 +10:00
Peter Hutterer
a668d91e28 dix: store the xi2mask on grabs and pass it around as needed.
This enables passive and implicit passive grabs for XI2 events, except that we
don't have the protocol spec yet to request them.
2009-03-20 15:17:56 +10:00
Peter Hutterer
97e89a5957 Allow XI2 event selection for AllDevices and AllMasterDevices. 2009-03-20 15:17:55 +10:00
Peter Hutterer
808a158182 dix: Enable XI2 delivery for events and focused events.
No support for grabbed events yet.
2009-03-20 15:17:55 +10:00
Peter Hutterer
87ff1159b4 dix: deliver device enter/leave events. 2009-03-20 15:17:55 +10:00
Peter Hutterer
3f37923a72 Xi: send XI2 focus events. 2009-03-20 15:17:55 +10:00
Peter Hutterer
daf7dd3bfe dix: Add GetWindowXI2Mask helper 2009-03-20 15:17:55 +10:00
Peter Hutterer
38bba0c1b7 Xi: Change ChangeMasterDeviceClasses to new XI2 events.
Split ChangeMasterDeviceClasses into an extra XISendDeviceChangedEvent that
assembles the XI2 wire event for the DeviceChanged event. Re-use this when
detaching the last SD.

Not quite perfect yet, we still copy the device classes from the slave now
rather than from the data we had when the event occured. But it's a start.

(We can now unexport SizeDeviceInfo and CopySwapDevices, not needed anymore)

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-03-20 15:17:55 +10:00
Peter Hutterer
181e41511d dix: fix up device enter/leave for XI_Enter/XI_Leave. 2009-03-20 15:17:55 +10:00
Peter Hutterer
0befeb36c1 dix: Add device info to DeviceChangedEvent, and fill in CCCE.
We need to fill the info here, as the device may change until we get a chance
to process it.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-03-20 15:17:55 +10:00
Peter Hutterer
b2ba77bac4 dix: add EventToXI2 and GetXI2Type.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-03-20 15:17:55 +10:00
Peter Hutterer
dfa2e8e966 Xi: add XIQueryDevice request handling. 2009-03-20 15:17:55 +10:00
Peter Hutterer
77d51b94bd dix: FixUpEventForWindow needs to handle XI2 events. 2009-03-20 15:17:54 +10:00
Peter Hutterer
95ed2ab715 Add XI2_EVENT check. 2009-03-20 15:17:54 +10:00
Peter Hutterer
43e48900fc dix: Force deviced ids of 2 and higher for actual devices.
0 is now reserved for the "AllDevices" virtual device.
1 is now reserved for the "AllMasterDevices" virtual device.

This also means that wherever we passed in (mskidx = 0), we now need to pass
in the deviceid.
2009-03-20 15:17:54 +10:00
Peter Hutterer
70896f6127 dix: abstract event filters through GetEventFilters.
Don't let everyone acces the filters[] array directly. This is necessary once
we start dealing with GenericEvents, where the filters are a bit more
complicated.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-03-20 15:17:54 +10:00
Peter Hutterer
8a8763f150 dix: restructure DeliverEventsToWindow, a little bit anyway.
Desperate attempt of making the code easy to read and understand. A failed
desparate attempt, possibly.
2009-03-20 15:17:54 +10:00
Peter Hutterer
891cfc8020 dix: clean up DeliverDeviceEvents.
Move mask checking into external function and streamline the code.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-03-20 15:17:54 +10:00
Peter Hutterer
445daa62e7 Xext: purge XGE event masks.
The masks were originally designed to generically handle event masks for
extensions. Since all that is in-server anyway, it's much better writing
custom event masks for those extensions that need it and not providing a
unified mechanism.
XI2 needs more than the current implementation, which is already too complex
for most other extensions. good riddance.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-03-20 15:17:53 +10:00
Peter Hutterer
6fe4c28bf4 Add agressive event type checking.
Best to FatalError if a wrong event comes in. At least that forces me to fix
it really quickly.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-03-20 15:17:53 +10:00
Peter Hutterer
497a125339 dix: remove duplicate PickKeyboard() command.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-03-20 14:48:57 +10:00
Peter Hutterer
7d4df0ee44 dix: fix device sync state when calling SyncBoth during AllowEvents.
This did access the wrong device's sync state, potentially freezing or not
thawing the actual device that was supposed to be thawed.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-03-20 14:48:57 +10:00
Peter Hutterer
f1c7b95d83 dix: do percentage check before device check in ProcBell
This is just for correctness. The server should return BadValue for anything
not in [-100, 100].

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-03-20 14:48:57 +10:00
Peter Hutterer
d60391d8ca dix: fix uncredible fail in PostSyntheticMotion.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-03-20 14:48:57 +10:00
Simon Thum
1a71862d33 dix/xfree86: simplified velocity approximation algorithm
Replace multi-stage filtering with simple linear velocity,
tracked several instances backwards. A heuristic ensures
only approximately linear motion is considered, so velocity
remains valid in any case. Numerical stability is much
better, and nothing changes to people who didn't tune the
advanced features of the previous algorithm.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-03-20 14:48:57 +10:00
Peter Hutterer
e8094d8f3f dix: ProcSendEvent shouldn't use inputInfo.keyboard directly.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-03-20 14:48:57 +10:00
Peter Hutterer
31301861c1 dix: remove wrong InputInfo.pointer usage - should be pDev instead. 2009-03-16 13:29:07 +10:00
Peter Hutterer
639658b2ea dix: use GetPairedDevice in ProcQueryPointer rather than inputInfo.keyboard. 2009-03-16 13:29:06 +10:00
Peter Hutterer
f01ee198ff dix: don't use inputInfo.keyboard to get the focus window in ActivateKbdGrab
I'm not sure if that's the right solution, but the other one is wronger.
2009-03-16 13:29:06 +10:00
Peter Hutterer
de415743f4 dix: fix XACE checks in ProcWarpPointer 2009-03-16 13:29:06 +10:00
Peter Hutterer
18430616cf dix: use PickPointer() and PickKeyboard instead of inputInfo.pointer/keyboard.
Affected calls:
 ProcChangeKeyboardControl
 ProcBell
 ProcUngrabKey
 ProcUngrabButton
2009-03-16 13:29:06 +10:00
Peter Hutterer
e31727158c dix: fix ProcChangePointerControl's wrong inputInfo.pointer usage.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-03-16 13:29:06 +10:00
Peter Hutterer
97cb3cc28e dix: Merge DevicePresence notify events generation into a single function.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-03-12 11:03:29 +10:00
Peter Hutterer
7f1ba804a1 dix: s/numEvents/num_events/ in GetKeyboardValuatorEvents
GPE and GProxE use the same.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-03-12 11:03:29 +10:00
Peter Hutterer
b368dd1720 dix: remove a few pointless (void) casts of return values.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-03-12 11:03:29 +10:00
Keith Packard
f8dd80d13b Replace dixLookupResource by dixLookupResourceBy{Type,Class}
dixLookupResource attempted to automatically detect whether the caller
wanted a lookup by-type or by-class, unfortunately, it guessed wrong for
RT_NONE. Instead of trying to make the guess better, this patch just reverts
the unification and creates separate functions for each operation.
2009-03-09 13:08:09 -07:00
Jason Vas Dias
e0ed9f16d0 Fix build with --enable-debug.
[amended by Peter Hutterer]
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-03-03 16:53:06 +10:00
Peter Hutterer
6093d3eb1d dix: fix two compiler warnings (old-style function definition).
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-03-03 07:07:30 +10:00
Peter Hutterer
59bc615ed2 dix: set the valuator mode in set_valuators
We only have per-device mode for now anyway.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-02-25 14:50:55 +10:00
Peter Hutterer
cffa3c499a dix: remove unused variable 'tmp'
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-02-25 14:50:55 +10:00
Peter Hutterer
a180c23679 dix: remove ConvertBackToXI.
This was a temporary solution for the internal-events rework and is not needed
anymore.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-02-25 14:40:08 +10:00
Peter Hutterer
26cf709e71 Doxygenify events.h and eventconvert.c
Should have done that before pushing, but oh well.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-02-25 14:40:08 +10:00
Peter Hutterer
d3b355875a dix: fix wrong condition for setting valuators on the event.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-02-24 11:20:23 +10:00
Peter Hutterer
a50c40be1f dix: don't apply button mappings to SDs, or the device's MD. (#20122)
Only ever change the button map on the device we actually care about, not the
attached SDs, not the current MD of the device.

X.Org Bug 20122 <http://bugs.freedesktop.org/show_bug.cgi?id=20122>

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Daniel Stone <daniel@fooishbar.org>
2009-02-23 18:54:53 +10:00
Peter Hutterer
bdc262701a dix: remove un-used getValuatorEvents and countValuatorEvents from getevents.c
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-02-23 17:52:40 +10:00
Peter Hutterer
763848d3ab Input: change processing API to InternalEvents.
Don't pass xEvent* and count through to processing, pass a single
InternalEvent.

Custom handlers are disabled for the time being. And for extra fun,
XKB's pointer motion emulation is disabled. But stick an error in there so
that we get reminded should we forget about it.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-02-23 17:52:40 +10:00
Peter Hutterer
085d503608 dix: Fix PostSyntheticMotion to use a DeviceEvent for posting.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-02-23 17:52:40 +10:00
Peter Hutterer
155986a93d dix: CheckPassiveGrabsOnWindow moved to internal events.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-02-23 17:52:40 +10:00
Peter Hutterer
1c38abd4b1 dix: switch DeliverGrabbedEvent to internal events.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-02-23 17:52:40 +10:00
Peter Hutterer
fb858774b8 dix: switch DeliverDeviceEvents to internal events.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-02-23 17:52:40 +10:00
Peter Hutterer
3aa9404fcd dix: switch DeliverFocusedEvent to internal events.
And because of xfree() macro hilarity, rename "pointer" to "ptr". Oh, how we
laughed.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-02-23 17:52:40 +10:00
Peter Hutterer
8c873e7f51 dix: Switch DeliverGrabbedEvents to use internal events.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-02-23 17:52:39 +10:00
Peter Hutterer
a371853698 dix: Deliver{Grabbed|Focused|Device}Events API changed to InternalEvents.
With the API change, we can now purge the XI conversion from POE.

Note: this commit breaks DGA even more.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-02-23 17:52:39 +10:00
Peter Hutterer
8f94ec6f78 dix: convert passive grabs to use internal events.
deviceGrab.sync.event is now an internal event, and CheckDeviceGrabs and
friends is changed over.

Note that this currently breaks some frozen grabs. See towards the end of
ComputeFreezes().

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-02-23 17:52:39 +10:00
Peter Hutterer
daa3245c47 dix: fix EnqueueEvent to work with internal events.
Note that we're only partially switched to internal events. The event in the
devices' event queue (dev->deviceGrab.sync.event) is still an XI event. The
events in syncEvents are InternalEvents only now.
This also implies fixing CheckVirtualMotion to work with internal events.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-02-23 17:52:39 +10:00
Peter Hutterer
75595ba4aa Xi: make ProcessOtherEvents more InternalEvent aware.
Get rid of the deviceValuator processing and a few other things, but still
drop back into XI before checking device grabs or doing anything else.

NoticeEventTime now needs to take InternalEvents, and while we're at it,
change NoticeTime from a macro to a function.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-02-23 17:52:39 +10:00
Peter Hutterer
3a02e538db dix: update CheckMotion to deal with DeviceEvents.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-02-23 17:52:39 +10:00
Peter Hutterer
8829d966a6 Xi: support InternalEvents in UpdateDeviceState, parts of POE and EnqueueEvent
Note that this breaks DGA. Life is tough.

EnqueueEvent is a somewhat half-baked solution, we immediately drop back into
XI and store them. But it should in theory work.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>

Don't let the dcce be random data.
2009-02-23 17:52:39 +10:00
Peter Hutterer
007e93c869 xkb: Switch the xkb event processing path over to InternalEvents.
Before dropping down into the DIX, convert back into XI events. This is a
temporary solution only, until the DIX is capable of handling InternalEvents
anyway.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-02-23 17:52:39 +10:00
Peter Hutterer
64ea607810 dix: change eventconvert to always return an array of xEvents
Just alloc the memory on demand rather than doing things with EventListPtrs
etc.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-02-23 17:52:39 +10:00
Peter Hutterer
4026c63e4e mi: switch the EQ to contain InternalEvents only.
This gets rid of the nevents parameter, InternalEvents are always a single
item per event. Also remove the special DeviceValuator handling in both
enqueueing and dequeueing.

Custom callback handlers are now broken until fixed.

For bisectability, we copy the InternalEvent back into the XI required during
POE and friends. Consider this a temporary solution.

Note: Because of misc linker bonghits, Xvfb won't link in this revision.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-02-23 17:52:39 +10:00
Peter Hutterer
5a827593f9 dix: switch event generation to InternalEvents.
GPE, GKVE, GProxE generate InternalEvents now.
DeviceClassesChangedEvents generates an InternalEvent now, but incomplete! We
need to tack on the information about the new SD in the ClassesChanged events.

Note: To make the progress bisectable, we drop back into XI events at the end of the
Get*Events functions. So the rest of the server still uses XI events.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-02-23 17:52:39 +10:00
Peter Hutterer
00b03683d0 dix: Add temporary conversion function ConvertBackToXI.
Until the InternalEvents are used throughout the server, we can use this one
to drop us back into XI la-la land where every event is the wire format.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-02-23 17:52:39 +10:00
Peter Hutterer
269d4d9f2e dix: add GetCoreType and GetXIType.
Convert from an InternalEvent type to the matching core/XI type. Currently
only for a few events, those we actually need in the server.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-02-23 17:52:38 +10:00
Peter Hutterer
656491921e dix: add InternalEvent -> core/xi event conversion routines.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-02-23 17:52:38 +10:00
Peter Hutterer
64e595d12e dix: check if keybd->key is valid before getting the keyboard state.
For floating SDs, GetPairedDevice() returns the SD itself, hence keybd->key
may be NULL.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-02-19 09:51:51 +10:00
Peter Åstrand
ddb8d8945d xserver: Avoid sending uninitialized padding data over the network
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-02-16 13:28:38 +10:00
Peter Hutterer
b735a4b495 dix: Remove lastEventMask variable, substitute with a #define.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-02-16 13:28:18 +10:00
Peter Hutterer
772e0f9159 dix: Don't set core events in SetMaskForEvent.
Rather, modify the two callers to call separately for the two different.
events. Unexport SetMaskForEvent too.
And while we're at it, get rid of the MotionFilter macro, because it's one
half confusing and one half pointless.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-02-16 13:28:17 +10:00
Benjamin Close
d62c085f36 dix: Remove includes which are not actually used directly
Signed-off-by: Benjamin Close <Benjamin.Close@clearchain.com>
Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Daniel Stone <daniel@fooishbar.org>
2009-02-13 17:23:43 +10:30
Peter Hutterer
340f1576af dix: remove DefineInitialRootWindow()
Obsolete.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-02-13 14:41:57 +10:00
Peter Hutterer
c178c3f814 dix: doxygen-ify enterleave.c
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-02-13 14:41:57 +10:00
Peter Hutterer
cc696a2b79 Doxygen-ify bits of events.c 2009-02-13 14:41:57 +10:00
Peter Hutterer
8364bf7374 Document the event masks.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-02-13 14:41:57 +10:00
Simon Thum
ed9d58c3c2 dix: refactor pointer acceleration
The algorithm is split in a 2D-specific and a general part.
This potentially allows to accelerate more than just screen motion.
A state machine is intoduced to make code more explicit and readable.
It also improves handling of 'phase 1' mickeys when axial correction
kicks in (corner case).

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-02-13 14:41:57 +10:00
Shunichi Fuji
7bbf05d9aa dix: build fix if PANORAMIX is not defined.
Signed-off-by: Shunichi Fuji <palglowr@gmail.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-02-10 16:06:35 +10:00
Peter Hutterer
5b2bbffc12 dix: deduplicate SyntheticMotion.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-02-10 14:26:59 +10:00
Peter Hutterer
34820f9c13 dix: remove XineramaChangeToCursor.
It's nearly identical to ChangeToCursor now anyway.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-02-10 14:26:57 +10:00
Peter Hutterer
942eae6868 dix: Remove XineramaCheckPhysLimits.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-02-10 14:26:55 +10:00
Peter Hutterer
bf044f6d10 dix: reduce redunancy in XineramaConfineCursorToWindow.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-02-10 14:26:53 +10:00
Peter Hutterer
cdce5699f0 dix: Get rid of XineramaCheckVirtualMotion.
Yes, this is an ugly piece mess of #ifdefs, but it beats having two nearly
identical functions.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-02-10 14:26:44 +10:00
Maarten Maathuis
1cb5afdf1e dix: always NULL pGC->tile.pixmap in Create{Scratch}GC. 2009-02-08 18:59:17 +01:00
Tomas Carnecky
9a1d07ecb7 Fix "warning: cast from pointer to integer of different size"
Signed-off-by: Tomas Carnecky <tom@dbservice.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-02-05 14:31:29 +10:00
Peter Hutterer
0e15697b53 dix: die if we can't activate or init the VCP/VCK.
If we have a busted xkb setup, the XKB initialization on the core devices
fails and leaves us with dev->key->xkbInfo == NULL. This in turn causes
segfaults lateron.

Return BadValue when the XKB configuration for a master device failed, and if
that happens for the VCP/VCK, die semi-gracefully.
The VCP init can only fail on OOM.

Reported by Aaron Plattner.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Daniel Stone <daniel@fooishbar.org>
Acked-by: Dan Nicholson <dbn.lists@gmail.com>
Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
2009-02-05 14:31:29 +10:00
Tomas Carnecky
bc57efffe6 Fix "warning: unused variable XXX"
events.c:4614: warning: unused variable ‘kbd’
xkbUtils.c:361: warning: unused variable ‘maxKeysPerMod’
xf86Events.c:409: warning: unused variable ‘ke’
generic.c:131: warning: unused variable ‘cs’
generic.c:130: warning: unused variable ‘size’
xf86RandR12.c:591: warning: unused variable ‘crtc’

Signed-off-by: Tomas Carnecky <tom@dbservice.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-02-04 09:41:25 +10:00
Tomas Carnecky
111fdef74d ISO C90: Move declaration to the beginning of the function
devices.c: In function ‘DoChangeKeyboardControl’:
devices.c:1768: warning: ISO C90 forbids mixed declarations and code

Signed-off-by: Tomas Carnecky <tom@dbservice.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-02-04 09:41:05 +10:00
Peter Hutterer
f80332a04d dix: for core events, pass the core filter into DeliverEventsToWindow
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-02-04 09:01:27 +10:00
Alan Coopersmith
5623c27700 Constify atom name strings
Changes MakeAtom to take a const char * and NameForAtom to return them,
since many callers pass pointers to constant strings stored in read-only
ELF sections.   Updates in-tree callers as necessary to clear const
mismatch warnings introduced by this change.

Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-02-03 10:06:00 -08:00
Peter Hutterer
412e09e1e3 dix: Use GenericEvent instead of LASTEvent to check for core events.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-02-03 11:13:54 +10:00
Peter Hutterer
a7e6424d99 dix: remove obsolete comment. Event lists should not be allocated by the DDX 2009-01-27 09:29:03 +10:00
Adam Jackson
132b464d73 Remove a bunch of useless casts.
We've had void * for twenty years now people let's try to act like we
know how it works.
2009-01-22 02:11:16 -05:00
Daniel Stone
18e51911f5 Input: Add postdown to ButtonClassRec
This mirrors that in KeyClassRec: the state of the buttons as posted to
GetPointerEvents, rather than the state of the buttons as processed by
ProcessOtherEvent and friends.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-01-22 15:09:00 +11:00
Daniel Stone
7af53799cc Input: Remove unused CoreProcess{Keyboard,Pointer}Event
Everything goes through XKB's Process{Keyboard,Pointer}Event on its way
through to ProcessOtherEvent now, so get rid of the old, useless functions.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-01-22 15:08:59 +11:00
Daniel Stone
4fa3872dc2 Input: Remove core keysyms from KeyClassRec
Instead of always keeping two copies of the keymap, only generate the
core keymap from the XKB keymap when we really need to, and use the XKB
keymap as the canonical keymap.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-01-22 15:08:59 +11:00
Daniel Stone
bc909f7136 Input: Centralise pointer map changing
Replace both core and Xi functions with one function that validates the
proposed map, and sends out both kinds of notification.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-01-22 15:08:58 +11:00
Daniel Stone
f06a9d2e05 Input: Clean up keymap change notifications
Keyboard map notifications are always generated from within XKB code,
which also takes care of copying the keysyms, etc.  If you need to
mangle the keymap yourself, generate a new core keymap/modmap, and pass
it to XkbApplyMappingChange.

SendMappingNotify is renamed to SendPointerMappingNotify (and ditto its
Device variants), which still only _sends_ the notifications, as opposed
to also doing the copying a la XkbApplyMappingChange.

Also have the modmap change code traverse the device hierachy, rather
than just going off the core keyboard.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2009-01-22 15:08:58 +11:00
Daniel Stone
32db27a7f8 Input: Remove modifierMap from core
We already have modmap (in the exact same format!) in XKB, so just use
that all the time, instead of duplicating the information.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-01-22 15:08:55 +11:00
Daniel Stone
f062e90a95 Input: Remove modifierKeyMap
Since modifierKeyMap is generated from modifierMap, just remove it, and
only generate it when we need to send the modifier map to the client.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-01-22 15:08:55 +11:00
Daniel Stone
cf6a2fc2bd Input: Ignore modifiers in core input processing
Modifiers get cleared by the XKB code when we drop down into core input
processing, so just delete the dead code path to simplify things a bit.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-01-22 15:08:55 +11:00