Commit Graph

1594 Commits

Author SHA1 Message Date
Peter Hutterer
2bfb802839 dix: don't XWarpPointer through the last slave anymore (#38313)
This line was introduced pre-1.6 to fix Bug 19297. The effect of warping
through the VCP then was that if a device had custom valuator ranges, the
warp position would be wrong. The better device for this effect is the the
XTest device.

This fixes a server crash where the lastSlave is a pointer device without
valuators (Bug 38313#0).

And while we're at it, make sure the Xinerama code-path does the same.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-08-22 15:56:53 +10:00
Peter Hutterer
3be379f507 dix: use helper functions in EventIsDeliverable
Proximity events don't have an XI2 type and caused error messages in the
log when trying to get the event filter. Use this opportunity to
clean up the code, instead of manually setting the fields that
GetEventFilter requires use EventTo(XI2|XI|Core) instead.

Co-Authored-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2011-08-22 15:56:53 +10:00
Peter Hutterer
7998797975 dix: abstract XI2 filter mask lookup
Don't access the xi2mask bytes directly or calculate the offsets manually,
use a few helper functions instead. XI2 masks are a bit weird in the event
handling code since they slot onto the legacy code. For core/XI 1.x events,
the event mask is a CARD32. That mask is used together with the event filter
(also 32 bit) to determine if event delivery should be attempted.
XI2 masks are of arbitrary size and their mask is simply the byte of the
mask that contains the event mask. Likewise, the filter is a single byte
matching that mask. Provide helper functions get these bytes and masks in
the right order instead of accessing them manually.

EventIsDeliverable should be part of this cleanup patch but it will be
gutted with the next patch.

Co-Authored-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2011-08-22 15:56:53 +10:00
Peter Hutterer
8c5a4d6fbe dix: don't use the pointer as modifier device in UngrabKey.
Modifier device is always the keyboard.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-08-22 15:56:52 +10:00
Peter Hutterer
3a077f246e input: provide a single function to init DeviceEvents to 0
getevents.c already had that function, but XKB was manually initializing it,
causing bugs when the event structure was updated in one place but not the
other.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-08-22 15:56:52 +10:00
Peter Hutterer
4b376ddeb4 dix: fix compiler warnings ("foo" set but not used)
devices.c: In function 'AttachDevice':
devices.c:2409:18: warning: variable 'oldmaster' set but not used
[-Wunused-but-set-variable]

events.c: In function 'ConfineToShape':
events.c:683:15: warning: variable 'pSprite' set but not used
[-Wunused-but-set-variable]

events.c: In function 'ProcGrabPointer':
events.c:4759:15: warning: variable 'time' set but not used
[-Wunused-but-set-variable]

getevents.c: In function 'GetMotionHistory':
getevents.c:425:9: warning: variable 'dflt' set but not used
[-Wunused-but-set-variable]

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-08-22 15:56:52 +10:00
Peter Hutterer
98fe735ea1 dix: add KEYBOARD_OR_FLOAT and POINTER_OR_FLOAT to GetMaster()
GetMaster() currently requires an attached slave device as parameter,
resuling in many calls being IsFloating(dev) ? dev : GetMaster(...);

Add two new parameters so GetMaster can be called unconditionally to get the
right device.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-08-22 15:56:51 +10:00
Peter Hutterer
09496996ac dix: ignore devices when adding passive core grabs to list (#39545)
Passive core grabs are mostly device-independent. In an MPX scenario, they
may change to reflect whichever master pair activated the grab last. For
adding new grabs to the list, ignore the device for core grabs to return
failures when trying to set the same grab combo twice on a window.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-08-22 15:56:50 +10:00
Peter Hutterer
80c3704853 dix: avoid using the VCP as modifier device
Core grabs may change device when they're activated to reflect the master
they apply to. If the device is a keyboard, modifierDevice is erroneously
set to the Virtual Core Pointer.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-08-22 15:56:50 +10:00
Peter Hutterer
f51e42f583 Terminate the log with one last message.
Instead of just closing the log when everything is done, put one more
message in stating that we're actually terminating. Users or scripts that
look at the Xorg.log will then know that a) the server has terminated
properly and b) why the server terminated (to some degree, given that most
real-world errors will be caused by AbortServer()).

Acked-by: Gaetan Nadon <memsize@videotron.ca>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Tested-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Tested-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-07-27 09:31:02 +10:00
Daniel Stone
c177a5bcaa Fix non-Composite builds in PrintWindowTree
The previous patch accidentally introduced a hard dependency on
Composite.  Sorry, OS X.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Reported-by: Jeremy Huddleston <jeremyhu@apple.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-07-15 15:44:06 +10:00
Daniel Stone
e084ac30b3 Input: Reset SD remainder when copying co-ords from MD
In updateSlaveDeviceCoords, pDev->last.valuators was being copied from
the master, but pDev->last.remainder wasn't.  Make sure we copy both, to
avoid minor inconsistencies.

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-07-01 08:46:28 +10:00
Peter Hutterer
23a7832789 input: add POINTER_NORAW to avoid generation of raw events (#30068)
RawEvents are supposed to be events coming from the driver. When warping the
pointer, this should not generate a raw event.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-07-01 08:46:28 +10:00
Daniel Stone
7d2543a3cb XKB: Add debug key actions for grabs & window tree
Add four new private XKB actions for debugging:
    * PrGrbs: print active grabs to the log file
    * Ungrab: ungrab all currently active grabs
    * ClsGrb: kill clients with active grabs
    * PrWins: dump the current window tree to the log file

To use these, you need to modify your XKB maps, e.g. the following to
have Ctrl+Alt+(F9-F12) mapped to the above:
 - compat/xfree86:
    interpret XF86LogGrabInfo {
        action = Private(type=0x86, data="PrGrbs");
    };
    interpret XF86Ungrab {
        action = Private(type=0x86, data="Ungrab");
    }
    interpret XF86ClearGrab {
        action = Private(type=0x86, data="ClsGrb");
    }
    interpret XF86LogWindowTree {
        action = Private(type=0x86, data="PrWins");
    }

 - symbols/pc:
    key <FK09> {        type="CTRL+ALT", [ Return, XF86LogGrabInfo      ]   };
    key <FK10> {        type="CTRL+ALT", [ Return, XF86Ungrab           ]   };
    key <FK11> {        type="CTRL+ALT", [ Return, XF86ClearGrab        ]   };
    key <FK12> {        type="CTRL+ALT", [ Return, XF86LogWindowTree    ]   };

At the moment, this only works if the grabbing client continues to call
AllowEvents, as the server does no event processing at all when a device
is frozen.

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-07-01 08:46:20 +10:00
Daniel Stone
ddf735fd4e DIX: Make PrintWindowTree actually useful
Rewrite PrintWindowTree to make it actually tell you what you want to
know.

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-07-01 08:46:15 +10:00
Scott James Remnant
2ee85d954c dix: avoid calling deleted block and wakeup handlers
BlockHandler and WakeupHandlers may be removed within a different
BlockHandler or WakeupHandler, especially since config/udev uses
these and removes devices.

Calling the deleted handlers and passing potentially freed data
can result in the X server segfaulting after device removal, or
events that result in device removal such as undocking or suspend/
resume.

Signed-off-by: Scott James Remnant <scott@netsplit.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-06-30 16:38:29 +10:00
Dan Nicholson
7d5c8a12cb Don't use empty source files
When an empty _SOURCES variable is declared, automake will recognize that
only linking is needed.

Signed-off-by: Dan Nicholson <dbn.lists@gmail.com>
Tested-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Tested-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-06-23 05:28:31 -07:00
Peter Hutterer
08a7246f43 dix: rename ProcessRawEvents to dix/events.c:DeliverRawEvent
No functional changes, prep work for future changes.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Cyril Brulebois <kibi@debian.org>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-06-08 13:57:05 +10:00
Peter Hutterer
a1beae635c dix: split DeliverEventToWindowMask up a bit more.
Move out the actual event delivery, it needs to be used from elsewhere.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-06-08 13:57:01 +10:00
Peter Hutterer
58e4831ed6 dix: rename DeliverEventsToClients to DeliverEventsToWindowMask
To avoid confusion with a future patch and it better describes what this
does anyway - delivering events to all clients that have the event mask on
the window.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-06-08 13:56:59 +10:00
Peter Hutterer
37a53f15b0 dix: split client list retrieval out of DeliverEventToClients
No functional change, but "other" was renamed to "clients".

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-06-08 13:56:57 +10:00
Peter Hutterer
0d140567ba dix: fix crashers with floating device.
dc57f89959 accidentally reversed the
conditions.

in dix/events.c we try to detach floating devices. This leads to a
NULL-dereference on GetMaster()->id.

in dix/getevents.c we try to get the master device for the floating slave
and dereference it.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-07 15:17:55 +10:00
Peter Hutterer
c042a267c4 dix: use xi2_get_type instead of manual typecast
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-03 14:43:05 +10:00
Peter Hutterer
b75cdb5bf7 dix: drop x/y back into the right valuators after transformation.
If the matrix is used for rotation, the coordinates affected may change.
e.g. a valuator mask of (x, nil) becomes [x, lasty] and is rotated to
[lasty, x]. Since the second value was unset, we would not drop x back into
the mask, resulting in a loss of movement.

Thus, drop any value that changed after applying the matrix into the
valuators. Thus, the example above becomes
(x, nil) → [x, lasty] → [lasty, x] → (lasty, x)

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Simon Thum <simon.thum@gmx.de>
2011-06-03 14:43:05 +10:00
Peter Hutterer
fe4b818700 dix: don't pass x/y to transformAbsolute
We passed in the mask, but didn't do anything with it. Move the logic to
take the axes out of the valuator masks into transformAbsolute.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Simon Thum <simon.thum@gmx.de>
2011-06-03 14:43:05 +10:00
Peter Hutterer
f94898928d dix: fix an error message.
event type, not device type.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-06-03 14:43:04 +10:00
Marko Macek
c5b72fd350 DIX: Set backgroundState correctly for root window
When we change the root window's background to None, and we've run with
-wr or -br for a forced solid background, make sure we also change the
background state to BackgroundPixel, so we don't try to lookup either
pScreen->whitePixel or pScreen->blackPixel as a pixmap.

Signed-off-by: Marko Macek <Marko.Macek@gmx.net>
Reviewed-by: Walter Harms <wharms@bfs.de>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-06-01 18:42:23 -07:00
Søren Sandmann Pedersen
8d84fd2566 Don't call pixman_disable_out_of_bounds_workaround() anymore
Pixman used to have a workaround for a bug in old X servers, and this
function was used to disable that workaround in servers known to be
fixed.

Since 0.22, which the X server depends on, the workaround doesn't
exist anymore, so there is no point disabling it.

Reviewed-by: Cyril Brulebois <kibi at debian.org>
Signed-off-by: Soren Sandmann <sandmann@cs.au.dk>
2011-05-25 12:14:05 -04:00
Simon Thum
b5d828789c xserver: remove AbsoluteClass, breaking the A(P|B)I
This struct was unused and has been effectively removed in
commit 633b81e8ba
Refs: xorg-server-1.10.0-133-g633b81e

Remove the remainder, with an ABI bump to 13.0.

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-05-25 08:23:58 +10:00
Jeremy Huddleston
4c4df3ac0d input: Don't implicitly define verify_internal_event
Fixes regression introduced by 5690199802

mieq.c:159:5: error: implicit declaration of function 'verify_internal_event' is invalid in C99 [-Wimplicit-function-declaration,Semantic Issue]
    verify_internal_event(e);
    ^
1 error generated.

Also includes some other warning cleanups in events.c we're there.

events.c:2198:24: warning: equality comparison with extraneous parentheses [-Wparentheses,Semantic Issue]
        else if ((type == MotionNotify))
                  ~~~~~^~~~~~~~~~~~~~~
events.c:2198:24: note: remove extraneous parentheses around the comparison to silence this warning [Semantic Issue]
        else if ((type == MotionNotify))
                 ~     ^              ~
events.c:2198:24: note: use '=' to turn this equality comparison into an assignment [Semantic Issue]
        else if ((type == MotionNotify))
                       ^~
                       =
events.c:2487:5: error: implicit declaration of function 'verify_internal_event' is invalid in C99 [-Wimplicit-function-declaration,Semantic Issue]
    verify_internal_event(event);
    ^
events.c:5909:22: warning: declaration shadows a local variable [-Wshadow,Semantic Issue]
        DeviceIntPtr it = inputInfo.devices;
                     ^
events.c:5893:18: note: previous declaration is here
    DeviceIntPtr it = inputInfo.devices;
                 ^
3 warnings and 1 error generated.

events.c:2836:27: warning: incompatible pointer types passing 'DeviceEvent *' (aka 'struct _DeviceEvent *') to parameter of type
      'const InternalEvent *' (aka 'const union _InternalEvent *')
    verify_internal_event(ev);
                          ^~
../include/inpututils.h:40:56: note: passing argument to parameter 'ev' here
extern void verify_internal_event(const InternalEvent *ev);
                                                       ^
1 warning generated.

Found-by: yuffie tinderbox (-Werror=implicit)
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-05-24 14:08:13 +10:00
Jeremy Huddleston
ba7d1020ac input: Fix format string for verify_internal_event
inpututils.c:577:25: warning: conversion specifies type 'unsigned short' but the argument has type 'unsigned char' [-Wformat,Format String Issue]
            ErrorF("%02hx ", *data);
                    ~~~~^    ~~~~~
                    %02hhx
1 warning generated.

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-05-24 14:08:13 +10:00
Jeremy Huddleston
25191648b8 XQuartz: Don't call mieqEnqueue during server shutdown
Found-by: GuardMalloc
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-05-14 19:15:27 -07:00
Peter Hutterer
728d0bf20e dix: replace CORE_EVENT and XI2_EVENT macros with inline functions.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
2011-05-13 09:42:04 +10:00
Peter Hutterer
c4f9c3a07d dix: use a tmp variable instead of multiple rClient(other).
no functional changes.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
2011-05-13 09:41:42 +10:00
Peter Hutterer
5bcc22757e dix: return deliveries from DeliverGrabbedEvent
This isn't currently used by any of the callers but it will likely be in the
future.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
2011-05-13 09:41:37 +10:00
Peter Hutterer
2054ca7306 dix: move the grab activation condition into a if block.
Rather than 3 conditions with if (deliveries && ...), have one block with
the three in them.
No functional changes.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
2011-05-13 09:41:36 +10:00
Peter Hutterer
236ed6f506 dix: split out client delivery from DeliverEventsToWindow
No real functional changes, this is just for improved readability.

DeliverEventsToWindow used to return an int to specify the number of
deliveries (or rejected deliveries if negative). The number wasn't used by
any caller other than for > 0 comparison.

This patch also changes the return value to be -1 or 1 even in case of
multiple deliveries/rejections. The comment was updated accordingly.

A future patch should probably use the enum EventDeliveryState for
DeliverEventsToWindow.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
2011-05-13 09:41:34 +10:00
Peter Hutterer
536ca28f1b dix: split out window owner event delivery from DeliverEventsToWindow
No functional changes, just for readability.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
2011-05-13 09:41:33 +10:00
Jamey Sharp
a311a03135 dix: split implicit grab activation into a separate function.
I'm not sure I like splitting the check for button-press event from the
code which makes assumptions about that check. How about replacing
patches 3 and 4 with this patch instead?

Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-05-13 09:41:29 +10:00
Peter Hutterer
c8674a328c dix: replace unneded goto with break.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-05-11 14:27:36 +10:00
Peter Hutterer
20fb07f436 input: remove DDX event list handling
The current approach to event posting required the DDX to request the event
list (allocated by the DIX) and then pass that list into QueuePointerEvent
and friends.

Remove this step and use the DIX event list directly. This means that
QueuePointerEvent is not reentrant but it wasn't before anyway.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-05-11 14:27:36 +10:00
Peter Hutterer
8670c46bdf input: replace EventListPtr with InternalEvent array
EventListPtr is a relic from pre-1.6, when we had protocol events in the
event queue and thus events of varying size.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-05-11 14:27:36 +10:00
Peter Hutterer
e7150db535 input: Provide Queue{Button|Keyboard|Proximity}Event helpers
Don't require every caller to use GPE + mieqEnqueue, provide matching
Queue...Event functions instead.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-05-11 14:27:33 +10:00
Daniel Stone
70cef8d8ba Input: Simplify CheckPassiveGrabsOnWindow loop
Instead of a mega never-ending if branch with no else, just continue
to the next iteration of the loop if the conditions aren't met - pretty
much entirely reindentation.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-05-06 13:15:18 +10:00
Daniel Stone
00ba884556 Input: Make CheckPassiveGrabsOnWindow take InternalEvent
Previously, it only took DeviceEvents, but it would be much more useful
if it took InternalEvents.  Any event that activates a grab must still
be a DeviceEvent, so put in a check to enforce this.

Change all callers to make the appropriate casts.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-05-06 13:15:16 +10:00
Peter Hutterer
5690199802 input: change CHECKEVENT macro to verify_internal_event function
The macro is sufficient if called during a development cycle, but not
sufficient information when triggered by a user (e.g.
https://bugzilla.redhat.com/show_bug.cgi?id=688693).

Expand what this does to print the event content and a backtrace, so at
least we know where we're coming from. Only the first 32 bytes are printed
since if something goes wrong, the event we have is almost certainly an
xEvent or xError, both restricted to 32 bytes.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-05-06 09:58:08 +10:00
Peter Hutterer
bf2059b07a input: Only release SD buttons for explicit floating/reattachment (#36146)
Grabbing an SD device temporary floats the device but we must not release
the buttons. Introduced in

    commit 9d23459415
    Author: Peter Hutterer <peter.hutterer@who-t.net>
    Date:   Fri Feb 25 11:08:19 2011 +1000

    dix: release all buttons and keys before reattaching a device (#34182)

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-05-05 10:29:17 +10:00
Daniel Stone
73de542104 Input: Fix event size confusion in CheckPassiveGrabsOnWindow
We were just storing a DeviceEvent, but allocating enough space for an
InternalEvent.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Julien Cristau <jcristau@debian.org>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Cyril Brulebois <kibi@debian.org>
2011-05-03 01:46:53 +01:00
Daniel Stone
7063264910 Input: Add DeepestSpriteWin function
Does what it says on the box: returns the deepest child window in a
given sprite's trace.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
2011-05-03 01:46:35 +01:00
Chase Douglas
65b54548dc Input: Pass co-ordinates by reference to transformAbsolute
With the upcoming XI 2.1 touch work, the co-ordinate values will need to
be passed by reference, rather than modified in-place.

Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-05-03 01:46:35 +01:00