summaryrefslogtreecommitdiff
path: root/dix
AgeCommit message (Collapse)AuthorFilesLines
2013-01-11Merge branch 'pointer-emulation-fixes-56558-v2' into for-keithPeter Hutterer2-24/+26
2013-01-11dix: typo fix in commentPeter Hutterer1-1/+1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-01-11dix: fix error logging occuring in signal context of GetTouchEventsBenjamin Tissoires1-4/+4
GetTouchEvents is usually called in a signal context. Calling ErrorF for the error messages leads to X complaining about log: (EE) BUG: triggered 'if (inSignalContext)' (EE) BUG: log.c:484 in LogVMessageVerb() (EE) Warning: attempting to log data in a signal unsafe manner while in signal context. Please update to check inSignalContext and/or use LogMessageVerbSigSafe() or ErrorFSigSafe(). The offending log format message is: %s: Attempted to start touch without x/y (driver bug) Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-01-11dix: don't filter RawEvents if the grab window is not the root window (#53897)Peter Hutterer1-3/+6
If a XI2.1+ client has a grab on a non-root window, it must still receive raw events on the root window. Test case: register for XI_ButtonPress on window and XI_RawMotion on root. No raw events are received once the press activates an implicit grab on the window. X.Org Bug 53897 <http://bugs.freedesktop.org/show_bug.cgi?id=53897> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com>
2013-01-09dix: remove already-moved hunkPeter Hutterer1-9/+0
Should've been removed in bc1f90a615018c05994fae3e678dd2341256cd82a, but got left here due to a botched rebase. Fixes stray button events sent to clients after deactivating an async pointer grab on a pointer-emulating-touch. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com>
2013-01-09dix: check for the right device's xi2 maskPeter Hutterer1-1/+1
events.c: In function 'DeactivatePointerGrab': events.c:1524:51: warning: 'dev' may be used uninitialized in this function [-Wuninitialized dev is unset when we get here, the device to check is "mouse". Introduced in ece8157a59751b3ed492fb2e1eb8d5f20221e195. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com>
2013-01-09dix: add resource type to touch listenersPeter Hutterer1-8/+10
Instead of guessing what resource type the listener is and what property to retrieve, store the resource type in the listener directly. Breaks XIT test cases: TouchGrabTestMultipleTaps.PassiveGrabPointerEmulationMultipleTouchesFastSuccession Fixes https://bugs.freedesktop.org/show_bug.cgi?id=56557 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com> Reviewed-by: Chase Douglas <chase.douglas@ubuntu.com>
2013-01-09input: Record grab pointer in TouchListenerKeith Packard2-7/+16
This places a pointer to the grab related to a TouchListener directly in the TouchListener structure rather than hoping to find the grab later on using the resource ID. Passive grabs have resource ID in the resource DB so they can be removed when a client exits, and those resource IDs get copied when activated, but implicit grabs are constructed on-the-fly and have no resource DB entry. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-12-19Merge remote-tracking branch 'yselkowitz/master'Keith Packard5-9/+9
I checked this patch with diff -w to check that it only affected whitespace.
2012-12-19Merge remote-tracking branch 'whot/barriers'Keith Packard3-4/+78
Conflicts: Xi/xichangehierarchy.c Small conflict with the patch from Xi: don't use devices after removing them Was easily resolved by hand. Signed-off-by: Keith Packard <keithp@keithp.com>
2012-12-18dix: don't copy the wrong event mask when activating a passive grabPeter Hutterer1-1/+4
GrabMask is a union of core, XI1 and XI2 masks. If a XI2 grab is activated, the value is a random pointer value, using it as mask has unpredictable effects. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net> Reviewed-by: Keith Packard <keithp@keithp.com>
2012-12-18dix: don't allow overriding a grab with a different type of grab (#58255)Peter Hutterer1-1/+1
If a client has a core grab, don't allow re-grabbing with type XI2, etc. This was the intent of the original commit xorg-server-1.5.99.1-782-g09f9a86, but ineffective. X.Org Bug 58255 <http://bugs.freedesktop.org/show_bug.cgi?id=58255> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com>
2012-12-17dix: ignore barrier events in FixUpEventFromWindowPeter Hutterer1-0/+2
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net>
2012-12-17dix: handle barrier events properly when converting to core/XI 1.xPeter Hutterer1-0/+4
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net>
2012-12-17dix: skip delivery if it's not the right pointer barrier clientPeter Hutterer1-0/+22
Only deliver to the client that created the barrier, not to other clients. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net>
2012-12-17Pass the event list through to the pointer barrier code to return itPeter Hutterer1-4/+11
Instead of having the pointer barrier code enqueue events separately from GetPointerEvents, pass the event list through and let it add to it. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net>
2012-12-17Add support for XI2.3: Pointer barrier events and releases.Jasper St. Pierre1-0/+39
This adds support for clients that would like to get a notification every time a barrier is hit, and allows clients to temporarily release a barrier so that pointers can go through them, without having to destroy and recreate barriers. Based on work by Chris Halse Rogers <chris.halse.rogers@canonical.com> Signed-off-by: Jasper St. Pierre <jstpierre@mecheye.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-12-12Merge branch 'stack-smash-on-touchpoint' into for-keithPeter Hutterer2-2/+18
2012-12-12dix: split xi2_mask_isset into a per-device functionPeter Hutterer1-9/+21
For touch selection conflicts, we need to check not only if the mask is set for the device, but if it is set for only that specific device (regardless of XIAll*Devices) Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-12-12dix: add FIXME, TouchRemovePointerGrab does nothingPeter Hutterer1-0/+2
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-12-12dix: when deactivating pointer-only grabs, don't emulate TouchEnd eventsPeter Hutterer1-1/+8
A client with a pointer grab on a touch device must reject the touch when detactivating the grab while the touch is active. However, such a rejecting must not trigger a ButtonRelease event to be emulated and sent to the client. Set the grabbing listener's state to HAS_END, so we simply skip delivery to that client. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-12-12dix: only reject active grabs on ungrab and do it before actually ungrabbingPeter Hutterer1-0/+9
An active grab ungrabbing is the same as rejecting the grab, since the client is no longer interested in those events. So reject any touch grab, but do so before actually deactivating since we're interested in the TouchEnd for the current grabbing client. A passive grab otoh is _not_ like rejecting a grab, since it deactivates automatically when the touch ends. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-12-12dix: don't call ProcessInputEvents() when accepting/rejecting touchesPeter Hutterer1-2/+0
TouchListenerAcceptReject may be called during normal event processing, but ProcessInputEvents is not reentrant and calling it here smashes the event queue. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-12-05Fix formatting of address operatorsYaakov Selkowitz5-9/+9
The formatter confused address operators preceded by casts with bitwise-and expressions, placing spaces on either side of both. That syntax isn't used by ordinary address operators, however, so fix them for consistency. Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-11-29Merge branch 'high-resolution-touch-devices' into for-keithPeter Hutterer2-93/+87
2012-11-29dix: use pixman for fp1616 conversionsPeter Hutterer1-19/+2
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Søren Sandmann <ssp@redhat.com>>
2012-11-29When resetting device idle time, reset XIAll(Master)Devices too (#56649)Peter Hutterer1-0/+2
When the screen saver is forcibly deactivated, the idle time counter is reset for all devices but not for the fake XIAllDevices and XIAllMasterDevices. XScreenSaverQueryInfo uses XIAlldevices to fill the "idle" field, thus returning the wrong value. Regression introduced in commit 6aef209ebc2e54f5465da505a780f7b4cc273ee0 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Mon Mar 12 13:51:02 2012 +1000 Change lastDeviceIdleTime to be per-device X.Org Bug 56649 <http://bugs.freedesktop.org/show_bug.cgi?id=56649> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Tested-by: Giacomo Perale <ghepeu@virgilio.it> Reviewed-by: Keith Packard <keithp@keithp.com>
2012-11-28dix/dispatch.c, os/utils.c: Disable smart scheduler on WIN32Jon TURNEY1-0/+4
setitimer() and SIGALRM aren't available on WIN32, so smart scheduler code cannot be built. Provide only stubs for smart scheduler timer code, and disable smart scheduler by default. Signed-off-by: Ryan Pavlik <rpavlik@iastate.edu> Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk> Tested-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net> Reviewed-by: Keith Packard <keithp@keithp.com>
2012-11-20dix: Save touchpoint last coordinates before transform. #49347Yuly Novikov1-14/+8
DDXTouchPointInfoRec.valuators used to store axis values after transform. This resulted in Coordinate Transformation Matrix being applied multiple times to the last coordinates, in the case when only pressure changes in the last touch event. Changed DDXTouchPointInfoRec.valuators to store values before transform. Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=49347 Signed-off-by: Yuly Novikov <ynovikov@chromium.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-11-20Simplify GetTouchEventsThomas Jaeger1-49/+17
With only one callee left, we are free to assume that !(flags & TOUCH_CLIENT_ID) Signed-off-by: Thomas Jaeger <ThJaeger@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-11-20Don't use GetTouchEvents in EmitTouchEndThomas Jaeger1-0/+31
As before GetTouchEvents causes unwanted side effects. Add a new function GetDixTouchEnd, which generates a touch event from the touch point. We fill in the event's screen coordinates from the MD's current sprite position. Signed-off-by: Thomas Jaeger <ThJaeger@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-11-20Don't use GetTouchEvents when replaying eventsThomas Jaeger1-34/+27
GetTouchEvents has plenty of side effects such as moving the pointer or updating the master device, which we don't want to happen when replaying. The only reason for calling it was to generate a DCCE event, but GetTouchEvents doesn't even do that right (we might need a DCCE event even when replaying a master event, or clients could interpret valuator data incorrectly). This discussion is moot at the moment anyway, since DeliverTouchEvents doesn't appear to deliver DCCE events. Signed-off-by: Thomas Jaeger <ThJaeger@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> [Added call to processInputProc instead of direct call to DeliverTouchEvents] Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-11-20Update the MD's position when a touch event is receivedThomas Jaeger1-0/+8
Signed-off-by: Thomas Jaeger <ThJaeger@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-11-19remove init_eventThomas Jaeger1-12/+1
The function is identical to init_device_event from inpututils.c with the first two arguments swapped. Signed-off-by: Thomas Jaeger <ThJaeger@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-11-19input: drop FP1616 macroPeter Hutterer3-8/+9
The double_to_f1616() functions do the same thing, and they're tested. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com>
2012-11-05Merge remote-tracking branch 'whot/for-keith'Keith Packard1-3/+5
2012-11-06dix: don't allow disabling XTest devicesPeter Hutterer1-3/+5
Disabling a XTest device followed by an XTest API call crashes the server. This could be fixed elsewhere but disabled devices must not send events anyway. The use-case for disabled XTest devices is somewhat limited, so simply disallow disabling the devices. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com>
2012-11-05dix: fix shadow warningsYaakov Selkowitz1-12/+12
dispatch.c: In function 'ProcCopyArea': dispatch.c:1608:5: warning: declaration of 'rc' shadows a previous local dispatch.c:1604:9: warning: shadowed declaration is here dispatch.c: In function 'ProcCopyPlane': dispatch.c:1647:5: warning: declaration of 'rc' shadows a previous local dispatch.c:1643:9: warning: shadowed declaration is here events.c: In function 'GetClientsForDelivery': events.c:2030:68: warning: declaration of 'clients' shadows a global declaration ../include/dix.h:124:28: warning: shadowed declaration is here events.c: In function 'DeliverEventToWindowMask': events.c:2113:19: warning: declaration of 'clients' shadows a global declaration ../include/dix.h:124:28: warning: shadowed declaration is here events.c: In function 'EventSuppressForWindow': events.c:4420:12: warning: declaration of 'free' shadows a global declaration Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-11-05dix: fix redundant redeclaration warnings in dixfontYaakov Selkowitz1-0/+9
These functions are already declared in <X11/fonts/fontproto.h>. Redeclaring them just for _X_EXPORT causes tons of warnings throughout xserver, but they need to be declared somewhere to be picked up by sdksyms.sh. Doing so in a private header limits the warnings to sdksyms.c; fixing those as well would require changes to fontsproto. Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-10-30Sync TouchListener memory allocation with population in TouchSetupListeners()Carlos Garnacho1-2/+2
The allocated TouchListener array may fall short by 1 if hitting the worst case situation where there's an active grab, passive grabs on each window in the sprite trace and event selection for touch in one of the windows. This may lead to memory corruptions as the array is overflown. Signed-off-by: Carlos Garnacho <carlosg@gnome.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-10-29dix: fix zaphod screen scrossing (#54654)Peter Hutterer1-2/+3
POINTER_SCREEN coordinates are screen-relative. For a Zaphod setup, the coordinates after a screen crossing are already relative to the new screen's origin. Add that offset to the coordinates before re-setting. regression introduced by commit bafbd99080be49a17be97d2cc758fbe623369945 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Wed Aug 8 11:34:32 2012 +1000 dix: work around scaling issues during WarpPointer (#53037) X.Org Bug 54654 <http://bugs.freedesktop.org/show_bug.cgi?id=54654> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com>
2012-10-19dix: fix Ungrab action #55785Lionel Elie Mamane1-1/+1
UngrabAllDevices(Bool kill_client): If we are not going to kill the client (kill_clients false), we need to deactivate grabs of active clients, too. (If we are going to kill the client, no need to deactivate the grab, as this will be done as part of the client kill.) Fixes: X.Org Bug 55785 <http://bugs.freedesktop.org/show_bug.cgi?id=55785> Signed-off-by: Lionel Elie Mamane <lionel@mamane.lu> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-10-19End physically active touches when device is disabledChase Douglas2-0/+29
Otherwise: * We can't end the touches while device is disabled * New touches after enabling the device may erroneously be mapped to old logical touches Signed-off-by: Chase Douglas <chase.douglas@canonical.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-10-10dix: fix crash on shutdown if a disabled device is still grabbed (XI1 grab)Peter Hutterer1-4/+12
A disabled device doesn't have a sprite (less so a sprite->win) and triggers a NULL-pointer dereference on shutdown when all active grabs are released as part of the cleanup. Fix this by checking for sprite being non-null and setting the focus window to the NullWindow if it is. The rest of the patch just attempts to make things more readable. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com>
2012-10-04Merge remote-tracking branch 'whot/for-keith'Keith Packard1-3/+6
2012-10-04dix: fix crash on XI 1.x grabs on disabled devices. (#54934)Peter Hutterer1-3/+6
If the device is disabled, the sprite window is NULL and dereferencing crashes the server. This is only triggered for XI 1.x grabs (ProcXGrabDevice) as XI2 grabs would trigger another code path, creating a sprite for the disabled device as if detaching it (which is wrong and fixed with this patch too). Grabbing a disabled device doesn't make sense as it won't send events anyway. However, the protocol specs do not prohibit it, so we need to keep it working. Luckily, oldWin is only used for focus out events, which aren't necessary given that the device is disabled. X.Org Bug 54934 <http://bugs.freedesktop.org/show_bug.cgi?id=54934> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@ubuntu.com>
2012-09-24Merge remote-tracking branch 'ajax/server-1.14-abi-churn'Keith Packard1-7/+12
2012-09-24dix: fix scale_to_desktop for edge ABS eventsYufeng Shen1-2/+2
Scale_to_desktop() converts ABS events from device coordinates to screen coordinates: [dev_X_min, dev_X_max] -> [screen_X_min, screen_X_max] [dev_Y_min, dev_Y_max] -> [screen_Y_min, screen_Y_max] An edge ABS event with X = dev_X_max (e.g., generated from the edge of a touchscreen) will be converted to have screen X value = screen_X_max, which, however, will be filterd out when xserver tries to find proper Window to receive the event, because the range check for a Window to receive events is window_X_min <= event_screen_X < window_X_max Events with event_screen_X = screen_X_max will fail the test get and rejected by the Window. To fix this, we change the device to screen coordinates mapping to [dev_X_min, dev_X_max] -> [screen_X_min, screen_X_max-1] [dev_Y_min, dev_Y_max] -> [screen_Y_min, screen_Y_max-1] Reviewed-by: Chase Douglas <chase.douglas@canonical.com> Reviewed-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com> Signed-off-by: Yufeng Shen <miletus@chromium.org> Signed-off-by: Keith Packard <keithp@keithp.com>
2012-09-23dix: Remove MapUnmapEventsEnabled and friendsAdam Jackson1-30/+3
This hack was added to suppress events generated by Composite's internal unmap/map cycle on redirection state change. Since that cycle was removed in 193ecc8b4, these can go. Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Ville Syrjälä <syrjala@sci.fi> Signed-off-by: Keith Packard <keithp@keithp.com>
2012-09-23dix: Factor out DeliverUnmapNotifyAdam Jackson1-16/+15
Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com>