summaryrefslogtreecommitdiff
path: root/dix
AgeCommit message (Collapse)AuthorFilesLines
2011-03-14Merge remote-tracking branch 'ajax/xserver-next'Keith Packard1-3/+9
2011-03-14Add mode field to pointer movement hooks.Peter Hutterer1-3/+9
Preparation work for pointer barriers. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-03-09Merge remote branch 'whot/for-keith'Keith Packard4-120/+128
2011-03-09input: warning fixesAdam Jackson1-0/+3
eventconvert.c:287:9: warning: enumeration value 'ET_Enter' not handled in switch eventconvert.c:287:9: warning: enumeration value 'ET_Leave' not handled in switch eventconvert.c:287:9: warning: enumeration value 'ET_FocusIn' not handled in switch eventconvert.c:287:9: warning: enumeration value 'ET_FocusOut' not handled in switch eventconvert.c:287:9: warning: enumeration value 'ET_DeviceChanged' not handled in switch eventconvert.c:287:9: warning: enumeration value 'ET_Hierarchy' not handled in switch eventconvert.c:287:9: warning: enumeration value 'ET_DGAEvent' not handled in switch eventconvert.c:287:9: warning: enumeration value 'ET_RawKeyPress' not handled in switch eventconvert.c:287:9: warning: enumeration value 'ET_RawKeyRelease' not handled in switch eventconvert.c:287:9: warning: enumeration value 'ET_RawButtonPress' not handled in switch eventconvert.c:287:9: warning: enumeration value 'ET_RawButtonRelease' not handled in switch eventconvert.c:287:9: warning: enumeration value 'ET_RawMotion' not handled in switch eventconvert.c:287:9: warning: enumeration value 'ET_XQuartz' not handled in switch eventconvert.c:287:9: warning: enumeration value 'ET_Internal' not handled in switch From the code it appears these are can't happens, so if they ever do, BadImplementation seems entirely appropriate. Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-03-09input: warning fixAdam Jackson1-1/+1
getevents.c:770:5: warning: suggest parentheses around '&&' within '||' Introduced with dc57f89959e549403f8488eb9f23425bd7118b22: - if(dev->u.master && dev->valuator) { + if(dev->valuator && IsMaster(dev) || !IsFloating(dev)) { So I'm assuming the two terms around the || are meant to be a unit. Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-03-09dix: Release input device config info when the device disconnects.Rami Ylimäki1-0/+2
Signed-off-by: Rami Ylimäki <rami.ylimaki@vincit.fi> Reviewed-by: Erkki Seppälä <erkki.seppala@vincit.fi> Reviewed-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-03-08dix: Remove deprecated.cAdam Jackson2-166/+0
No more internal users, this can be dropped now. Reviewed-by: Soren Sandmann <ssp@redhat.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-03-03Merge remote branch 'whot/for-keith'Keith Packard6-154/+261
2011-03-03Merge remote branch 'sandmann/for-keithp'Keith Packard1-234/+0
2011-03-03Merge remote branch 'rjy/clientids'Keith Packard2-0/+13
2011-03-02dix: change all timestamps in pointer acceleration to CARD32Simon Thum1-2/+2
CARD32 is being returned by GetTimeInMilis(), so use it consistently. Signed-off-by: Simon Thum <simon.thum@gmx.de> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-03-02dix: update pointer acceleration code to use ValuatorMaskSimon Thum2-87/+62
Signed-off-by: Simon Thum <simon.thum@gmx.de> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-03-02dix: refactor predictable scheme initializationSimon Thum1-30/+58
This intends to clean up the predictable accel struct from purely scheme-related things like input properties, as they would be useless in other use cases such as wheel acceleration. Signed-off-by: Simon Thum <simon.thum@gmx.de> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-03-01Delete RegionClipSpans()Søren Sandmann Pedersen1-234/+0
Nothing uses it. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Søren Sandmann Pedersen <ssp@redhat.com>
2011-02-28Merge branch 'next' into for-keithPeter Hutterer6-154/+219
Conflicts: dix/devices.c Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-02-25input: Ensure Valuator axes are aligned as neededKeith Packard1-6/+8
Let the compiler figure out the correct alignment for the axes data for a valuator by using a union to force double alignment of the initial ValuatorClassRec structure in the allocation. Signed-off-by: Keith Packard <keithp@keithp.com> Tested-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Julien Cristau <jcristau@debian.org>
2011-02-25dix: release all buttons and keys before reattaching a device (#34182)Peter Hutterer1-0/+42
Testcase: xinput float <keyboard name> results in the keyboard's enter key being repeated as the device is detached while the key is still physically down. To avoid this, release all keys and buttons before reattaching the device. X.Org Bug 34182 <http://bugs.freedesktop.org/show_bug.cgi?id=34182> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Fernando Carrijo <fcarrijo@freedesktop.org>
2011-02-23Merge branch 'mi-cleanup' into nextPeter Hutterer5-39/+62
2011-02-23Input: Don't freeze unrelated devices in DeliverGrabbedEventDaniel Stone1-4/+3
When delivering an event to a device grabbed with SyncBoth, DeliverGrabbedEvent walks the device tree looking for associated devices to freeze them. Unfortunately, it froze all devices instead of just the paired device, and the previous fix in 4fbadc8b17237f3c would still break if the same client had a non-SyncBoth grab on another unrelated master device. Fix this by completely ignoring devices that aren't our paired device. 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>
2011-02-22Move master/lastSlave out of the union into separate fields.Peter Hutterer3-11/+11
The removal of the double-use will cause some suble bugs as some conditions to check for the dev->u.master case were broken and also evaluated as true if lastSlave was set (instead of master). Also breaks the input ABI. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Benjamin Tissoires <tissoire@cena.fr>
2011-02-22input: Change a bunch of direct dev->u.master accesses to use GetMaster()Peter Hutterer2-7/+7
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Benjamin Tissoires <tissoire@cena.fr>
2011-02-22dix: fix a master device access in change_modmap.Peter Hutterer1-2/+2
We need to check if our master keyboard is the given device since we may be a pointer with keys and thus need to change the modmap too. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Benjamin Tissoires <tissoire@cena.fr>
2011-02-22dix: fix up a master check in ChangeKeyboardMapping handling.Peter Hutterer1-1/+1
We don't just care about the directly attached master, we care about the master keyboard. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Benjamin Tissoires <tissoire@cena.fr>
2011-02-22dix: add MASTER_ATTACHED as allowed type for GetMaster().Peter Hutterer1-2/+5
In some cases, we don't know/care whether we want the master pointer or keyboard for a device. Add a new type MASTER_ATTACHED to return the master this device is attached to. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Benjamin Tissoires <tissoire@cena.fr>
2011-02-22Switch to use IsFloating()Peter Hutterer4-11/+11
This is not a straightforward search/replacement due to a long-standing issue. dev->u.master is the same field as dev->u.lastSlave. Thus, if dev is a master device, a check for dev->u.master may give us false positives and false negatives. The switch to IsFloating() spells out these cases and modifies the conditions accordingly to cover both cases. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Benjamin Tissoires <tissoire@cena.fr>
2011-02-22dix: Add IsFloating(device) wrapper.Peter Hutterer1-0/+7
Simplifies check for floating devices. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Benjamin Tissoires <tissoire@cena.fr>
2011-02-22dix: Simplify retrieving the master device.Peter Hutterer1-1/+1
GetMaster() returns NULL for floating slaves. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Benjamin Tissoires <tissoire@cena.fr>
2011-02-22dix: replace direct master access with GetMaster and temp. device.Peter Hutterer1-4/+5
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Benjamin Tissoires <tissoire@cena.fr>
2011-02-22dix: a valuator number of 0 is valid (#34510)Peter Hutterer1-2/+14
For all but motion and proximity events, having no valuators is ok. Regression from 1.9, keyboard events are not converted to protocol events. X.Org Bug 34510 <http://bugs.freedesktop.org/show_bug.cgi?id=34510> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Tested-by: Timo Aaltonen <timo.aaltonen@canonical.com>
2011-02-17dix: avoid FP promotion during pointer accelerationSimon Thum1-2/+2
Signed-off-by: Simon Thum <simon.thum@gmx.de> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-02-17dix: refactor scheme initSimon Thum2-45/+46
This makes it possible to init a scheme in one init call, so we get rid of the tightly coupled two-phase init used before. Signed-off-by: Simon Thum <simon.thum@gmx.de> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-02-17Input: Allow EventToCore to return multiple eventsDaniel Stone2-39/+57
Some event types (notably Expose and GraphicsExpose) require multiple events, a la XI 1.x. Bring the EventToCore API in line with EventToXI's and allow it to generate multiple events. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-02-17Input: Reduce use of filter in DeliverEventsDaniel Stone1-7/+37
Instead of switching on the event filter to determine delivery, use the event type instead. 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>
2011-02-17Input: Rename EventIsDeliverable return masksDaniel Stone1-15/+11
Rename the return mask values for EventIsDeliverable: * CORE_MASK -> EVENT_CORE_MASK * XI_MASK -> EVENT_XI1_MASK * XI2_MASK -> EVENT_XI2_MASK * DONT_PROPAGATE_MASK -> EVENT_DONT_PROPAGATE_MASK And don't undef them in dix/events.c, since they're supposed to be global. 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>
2011-02-17Input: Store passive-activating key in CheckDeviceGrabsDaniel Stone1-5/+15
CheckDeviceGrabs will activate a passive grab for KeyPress and ButtonPress events. GrabInfoRec::activatingKey contains the keycode which activated the passive grab, so we can deactivate it later in ProcessOtherEvents. Previously, CheckDeviceGrabs relied on its callers to set activatingKey, which not all callers were doing (I'm looking at you, ComputeFreezes). Just set it in CheckDeviceGrabs instead. 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>
2011-01-20Merge remote branch 'ajax/for-keithp'Keith Packard1-25/+17
2011-01-20resource: Fix indentationAdam Jackson1-14/+14
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-01-20resource: Remove expectID hackAdam Jackson1-7/+0
This is clearly meant to short-circuit the (modestly) expensive resource lookup in LegalNewID. The problem is that long-lived clients will eventually run completely through their XID space and start asking XC-MISC for IDs to reuse. Once that happens, the comparison against expectID will always be true, and we'll no longer catch XID collisions at all. Reviewed-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-01-20resource: s/NullResource/NULL/gAdam Jackson1-4/+3
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-01-07Merge branch 'for-peter' of git://people.freedesktop.org/~daniels/xserver ↵Peter Hutterer1-62/+56
into for-keith
2011-01-07input: add valuator_mask_free() to free a valuator mask.Peter Hutterer1-0/+8
Expecting the caller to free the mask requires us to keep it in a single memory block (which may be an issue lateron), aside from leaving the API asymetrical. Provide valuator_mask_free() to free the memory and reset the mask pointer to NULL. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Fernando Carrijo <fcarrijo@freedesktop.org> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2011-01-07Input: Prevent MD grabs from wandering on to other MDsDaniel Stone1-1/+1
The code to set sync.other in DeliverGrabbedEvents is supposed to reset sync.other for a paired MD to the grab under consideration, but was rather optimistic in resetting sync.other for _all_ devices. This would fall apart given two sets of MDs (A paired with B, Y paired with Z), where both MDs were in FREEZE_BOTH_NEXT_EVENT due to being called with SyncBoth, where no event had yet triggered the grab. An event being processed on MD A would result in B, Y and Z all having sync.other set to A's grab, rather than just B. 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>
2011-01-06Input: Make CheckPassiveGrabsOnWindow return grab, exportDaniel Stone1-15/+15
Change CheckPassiveGrabsOnWindow to return the GrabPtr it used (or NULL if none) rather than a boolean, and export it. Also add an additional boolean 'activate' parameter; use TRUE for existing behaviour, or FALSE to only find the grab and then return it. This will be used in forthcoming touch patches to find the grabs, rather than open-coding same. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-01-06Input: Export GetEventMaskDaniel Stone1-1/+1
Make it non-static, add to headers. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2011-01-06Input: Handle grabs with no Xi 1.x equivalentDaniel Stone1-2/+2
Don't try to search for an Xi 1.x grab in CheckPassiveGrabsOnWindow for events with no Xi 1.x equivalent. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2011-01-06Input: Pass sprite instead of device to XYToWindow, make non-staticDaniel Stone1-13/+6
XYToWindow calculates the position of the cursor and updates the sprite trace, but does nothing else with the device. Pass a SpritePtr instead so we can update an alternate focus instead of hardcoding the device's sprite. Also make this function non-static, so we can use it elsewhere. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2011-01-06Input: Pass sprite instead of device to FixUpEventFromWindowDaniel Stone1-22/+21
Since FixUpEventFromWindow only uses the sprite trace to determine the window stack, pass in a sprite instead of hardcoding the device sprite, so we can deliver to windows other than the one currently containing the sprite. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2011-01-06Input: Make RootWindow() take a sprite instead of deviceDaniel Stone1-12/+14
GetCurrentRootWindow already works for the device case, although not as an lvalue. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2011-01-05composite: Support updating an arbitrary subtreeVille Syrjälä1-0/+4
Rename compUpdateWindow to compPaintWindowToParent and split the child walk to compPaintChildrenToWindow. Calling compPaintChildrenToWindow allows an arbitrary subtree to be updated, instead of having to update all the windows. This will be used to make sure all the descendants are copied to the parent when the parent window contents need to be accessed in IncludeInferios sub-window mode. WindowRec has a new member 'damagedDescendants' that is used to keep track of which subtrees need updating. When a window is damaged, 'damagedDescendants' will be set for all the ancestors, and when a subtree is updated, the tree walk can be stopped early if no damaged descendants are present. CompScreenRec no longer needs the 'damaged' member since the root window's 'damagedDescendants' provides the same information. Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-12-31DIX: Reset window properties when freeing themDaniel Stone1-0/+3
This enables us to reliably inspect properties when destroying windows. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Fernando Carrijo <fcarrijo@freedesktop.org>