Commit Graph

668 Commits

Author SHA1 Message Date
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
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
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
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
Alan Coopersmith
a14a0c7113 Move event filter initializer out of the structure itself
When kept in the structure, it causes the entire MAXDEVICES * 128 masks
to be stored in the data segment and loaded from the file, and also leads
to worries about later generations inheriting changes across server reset.

           text    data     bss     dec     hex filename
Before:   91837   20528      32  112397   1b70d .libs/events.o
After:    92277      48   20512  112837   1b8c5 .libs/events.o
Before: 3013384  122696  163156 3299236  3257a4 Xorg
After:  3013832  102216  183636 3299684  325964 Xorg

File size before:       4337008 Xorg
File size after:        4316568 Xorg

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-05-03 01:46:35 +01:00
Nicolas Kaiser
86c0c8b9c5 dix: remove duplicated includes
Remove duplicated includes.

Signed-off-by: Nicolas Kaiser <nikai@nikai.net>
Reviewed-by: Matthieu Herrb <matthieu.herrb@laas.fr>
2011-04-24 19:46:06 -07:00
Dave Airlie
5fb329a04a panoramiX: convert 1->panoramiXNumScreens loops to use macro (v2)
This converts all the remaining 1->num loops to the macro,
this removes nearly all the panoramiXNumScreens usage in
loops, and is a step to replacing it.

v2: move some from the other patch.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-03-10 11:01:51 +10:00
Dave Airlie
0bccfcc97b panoramiX: convert 0->panoramiXNumScreens loops to macro (v3)
This just uses the FOR_NSCREENS macro instead.

v2: remove some of the 1->x loops.
v3: drop the 1->0 loop, will rework later.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-03-10 11:01:09 +10:00
Peter Hutterer
579ee8f5d8 Merge branch 'mi-cleanup' into next 2011-02-23 08:44:42 +10:00
Daniel Stone
b636893137 Input: Don't freeze unrelated devices in DeliverGrabbedEvent
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 4fbadc8b17 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-23 08:20:16 +10:00
Peter Hutterer
17265ccb02 Move master/lastSlave out of the union into separate fields.
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-22 14:35:45 +10:00
Peter Hutterer
77113dd3ee input: Change a bunch of direct dev->u.master accesses to use GetMaster()
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <tissoire@cena.fr>
2011-02-22 14:35:45 +10:00
Peter Hutterer
dc57f89959 Switch to use IsFloating()
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-22 14:35:44 +10:00
Peter Hutterer
703baece7e dix: Add IsFloating(device) wrapper.
Simplifies check for floating devices.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <tissoire@cena.fr>
2011-02-22 14:35:44 +10:00
Peter Hutterer
77af45ebc3 dix: Simplify retrieving the master device.
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-22 14:35:44 +10:00
Daniel Stone
46b4979601 Input: Allow EventToCore to return multiple events
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-17 09:40:59 +10:00
Daniel Stone
ea71495ada Input: Reduce use of filter in DeliverEvents
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-17 09:39:41 +10:00
Daniel Stone
8a0241656c Input: Rename EventIsDeliverable return masks
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-17 09:39:36 +10:00
Daniel Stone
da39d57a20 Input: Store passive-activating key in CheckDeviceGrabs
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-02-17 09:10:10 +10:00
Peter Hutterer
8456625d64 Merge branch 'for-peter' of git://people.freedesktop.org/~daniels/xserver into for-keith 2011-01-07 09:35:07 +10:00
Daniel Stone
4fbadc8b17 Input: Prevent MD grabs from wandering on to other MDs
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-07 08:28:23 +10:00
Daniel Stone
ce74e7562d Input: Make CheckPassiveGrabsOnWindow return grab, export
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-06 17:11:00 +00:00
Daniel Stone
eb5aaf5eb8 Input: Export GetEventMask
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-06 17:10:44 +00:00
Daniel Stone
30c8c7a863 Input: Handle grabs with no Xi 1.x equivalent
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-06 17:10:41 +00:00
Daniel Stone
690476250f Input: Pass sprite instead of device to XYToWindow, make non-static
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-06 17:10:41 +00:00
Daniel Stone
07a892cd82 Input: Pass sprite instead of device to FixUpEventFromWindow
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-06 17:10:36 +00:00
Daniel Stone
10d6c3ca10 Input: Make RootWindow() take a sprite instead of device
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-06 17:10:33 +00:00
Chase Douglas
4781828798 Make EventIsDeliverable non-static
Will be used outside dix/events.c in proceeding XI 2.1 MT changes.

Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-12-31 12:36:44 +00:00
Daniel Stone
f7d8ade3c5 Resources: Move rClient to resource.h
The definition of rClient was duplicated across three source files, so
move it to resource.h.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-12-31 12:36:44 +00:00
Alan Coopersmith
2db6951763 Sun's copyrights now belong to Oracle
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net>
2010-12-07 11:10:35 -08:00
Jamey Sharp
8efa3623f3 Use GetCurrentRootWindow or equivalent instead of spriteTrace[0].
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>
2010-10-13 15:58:12 +10:00
Jamey Sharp
32de0c1907 Move replay-window check from ComputeFreezes to CheckDeviceGrabs.
This just simplifies ComputeFreezes, eliminating some duplicated code
and a goto.

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>
2010-10-13 15:58:07 +10:00
Jamey Sharp
1c1811ecaf CheckDeviceGrabs: Delete redundant pWin->optional test.
CheckPassiveGrabsOnWindow returns FALSE if pWin->optional is NULL,
because wPassiveGrabs uses wUseDefault, so don't bother checking at the
caller.

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>
2010-10-13 15:58:06 +10:00
Jamey Sharp
c360b3eb1d Let CheckPassiveGrabsOnWindow callers check if device is already grabbed.
CheckDeviceGrabs checked all the ancestors of the window containing this
device's pointer even if no new grabs could possibly apply due to the
device already being grabbed.

ActivateFocusInGrab and ActivateEnterGrab already checked whether they
should break an existing grab, and then set up an event that was
completely ignored if they didn't actually break the grab.

In both cases, just do what we would have done eventually anyway--return
FALSE from CheckPassiveGrabsOnWindow's caller--but do it sooner.

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>
2010-10-13 15:58:04 +10:00
Peter Hutterer
fd4f5059f0 dix: purge leftover manual key down bit setting.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2010-07-07 13:29:46 +10:00
Peter Hutterer
1884db430a Revert "dix: use the event mask of the grab for TryClientEvents."
Behaviour of earlier X servers was to deliver the ButtonPress event
unconditionally, regardless of the actual event mask being set. This is
documented in the protocol:
"This request establishes a passive grab.  In the future, the pointer is
actively grabbed as described in GrabPointer, the last-pointer-grab time is
set to the time at which the button was pressed (as transmitted in the
ButtonPress event), and the ButtonPress event is reported if all of the
following conditions are true:
    <list of conditions, event mask is not one of them>"

Thus, a GrabButton event will always deliver the button press event, a
GrabKey always the key press event, etc. Same goes for XI and XI2.

Reproducible with a simple client requesting a button grab in the form of:
    XGrabButton(dpy, AnyButton, AnyModifier, win, True, ButtonReleaseMask,
                GrabModeAsync, GrabModeAsync, None, None);

On servers before MPX/XI2, the client will receive a button press and
release event. On current servers, the client receives only the release.
Clients that expect the press event to be delivered unconditionally.

XTS Xlib13 XGrabButton 5/39 now passes.

This reverts commit 48585bd1e3.
Effectively reverts commit 1c612acca8 as well,
the code introduced with 1c612 is not needed anymore.

Conflicts:

	dix/events.c

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Keith Packard <keithp@keithp.com>
2010-06-28 11:52:13 +10:00
Mikhail Gusarov
7287ef9e6c Remove unnecessary parentheses around return values in functions
This patch was generated by the following Perl code:

perl -i -pe 's/([^_])return\s*\(\s*([^(]+?)\s*\)s*;(\s+(\n))?/$1return $2;$4/g;'

Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-06-10 06:42:42 -07:00
Mikhail Gusarov
0a4d8cbdcd Remove more superfluous if(p) checks around free(p)
This patch has been generated by the following Coccinelle semantic patch:

@@
expression E;
@@

-if(E) { free(E); }
+free(E);

Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
Reviewed-by: Fernando Carrijo <fcarrijo@yahoo.com.br>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2010-06-06 20:27:18 +07:00
Mikhail Gusarov
5a0fc0ad21 Replace deprecated bzero with memset
Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Marcin Baczyński <marbacz@gmail.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2010-06-06 15:07:27 +07:00
Jamey Sharp
a0fe6987b5 Clean up after removal of screen parameters from region macros.
Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2010-06-05 22:07:21 -07:00
Keith Packard
2dc138922b Rename region macros to eliminate screen argument
This is a combination of a huge mechanical patch and a few small
fixups required to finish the job. They were reviewed separately, but
because the server does not build without both pieces, I've merged
them together at this time.

The mechanical changes were performed by running the included
'fix-region' script over the whole tree:

$ git ls-files | grep -v '^fix-' | xargs ./fix-region

And then, the white space errors in the resulting patch were fixed
using the provided fix-patch-whitespace script.

$ sh ./fix-patch-whitespace

Thanks to Jamey Sharp for the mighty fine sed-generating sed script.

The hand-done changes involve removing functions from dix/region.c
that duplicate inline functions in include/regionstr.h, along with
their declarations in regionstr.h, mi.h and mispans.h.

Reviewed-by: Jamey Sharp <jamey@minilop.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-06-05 18:59:00 -07:00
Jamey Sharp
a0456da339 XineramaSetCursorPosition: use screen bounds directly, not POINT_IN_REGION.
This hides a MAXSCREENS-sized array as an implementation detail of
panoramiX.c rather than an exported global.

Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Tested-by: Tiago Vignatti <tiago.vignatti@nokia.com> (i686 GNU/Linux)
2010-06-03 14:03:23 -07:00
Jamey Sharp
a83cff9f4d Move each screen's x/y origin into ScreenRec.
Many references to the dixScreenOrigins array already had the
corresponding screen pointer handy, which meant they usually looked like
"dixScreenOrigins[pScreen->myNum]". Adding a field to ScreenRec instead
of keeping this information in a parallel array simplifies those
expressions, and eliminates a MAXSCREENS-sized array.

Since dix declared the dixScreenOrigins array, I figure allocating a
screen private for these values is overkill.

Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Tested-by: Tiago Vignatti <tiago.vignatti@nokia.com> (i686 GNU/Linux)
2010-06-03 14:03:23 -07:00
Jamey Sharp
217ccaa5a3 Delete panoramiXdataPtr: it's redundant.
This eliminates a dynamically-allocated MAXSCREENS-sized array.

Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Tested-by: Tiago Vignatti <tiago.vignatti@nokia.com> (i686 GNU/Linux)
2010-06-03 14:03:23 -07:00
Jamey Sharp
e7fae9ecc4 Move each screen's root-window pointer into ScreenRec.
Many references to the WindowTable array already had the corresponding
screen pointer handy, which meant they usually looked like
"WindowTable[pScreen->myNum]". Adding a field to ScreenRec instead of
keeping this information in a parallel array simplifies those
expressions, and eliminates a MAXSCREENS-sized array.

Since dix uses this data, a screen private entry isn't appropriate.

xf86-video-dummy currently uses WindowTable, so it needs to be updated
to reflect this change.

Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Tested-by: Tiago Vignatti <tiago.vignatti@nokia.com> (i686 GNU/Linux)
2010-06-03 14:03:23 -07:00
Jamey Sharp
e291c56182 Return an appropriately-typed error from dixLookupResourceByType.
Rather than always returning BadValue, associate an error status like
BadWindow with a resource type like RT_WINDOW, and return the
appropriate one for the requested type.

This patch only touches the core protocol resource types. Others still
return BadValue and need to be mapped appropriately.

dixLookupResourceByType can now return BadImplementation, if the caller
asked for a resource type that has not been allocated in the server.

Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2010-05-19 12:32:48 -07:00
Jamey Sharp
8033fb6c97 Set event sequence number in WriteEventsToClient instead of at callers.
TryClientEvents already did this; this commit just moves the assignment
one level down so that no event source has to worry about sequence
numbers.

...No event source, that is, except XKB, which inexplicably calls
WriteToClient directly for several events.

Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2010-05-19 12:32:34 -07:00
Jamey Sharp
4b9600a416 Make WriteEventsToClient/WriteToClient no-op on fake or dead clients.
This matches the test in TryClientEvents, and is a superset of tests
done by the callers of these functions. The consequence of forgetting
these tests is a server crash, so they're always desirable. In my
opinion, it's better to not require the callers to remember to do these
checks.

For callers that don't do very much work before calling WriteToClient or
WriteEventsToClient, I've removed the redundant checks.

hw/xquartz/xpr/appledri.c has an interesting case: While its check for
"client == NULL" appears redundant with the test in WriteEventsToClient,
it dereferences client to get the sequence number.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=27497
Signed-off-by: Jamey Sharp <jamey@minilop.net>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Julien Cristau <jcristau@debian.org>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2010-05-19 12:32:34 -07:00
Mikhail Gusarov
3f3ff971ec Replace X-allocation functions with their C89 counterparts
The only remaining X-functions used in server are XNF*, the rest is converted to
plain alloc/calloc/realloc/free/strdup.

X* functions are still exported from server and x* macros are still defined in
header file, so both ABI and API are not affected by this change.

Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-05-13 00:22:37 +07:00
Keith Packard
cdeb2c23f8 Fix cursor ref counting mistakes with sprites and xf86Cursor.c
A few cursor value assignments weren't getting correctly ref counted,
causing leaks of cursor objects.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-05-03 10:26:52 -07:00
Tiago Vignatti
4971099860 dix: wrap variables with #ifdef when panoramix is not used
this shut up some warnings.

Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-05-02 13:55:16 -07:00
Keith Packard
65e961fcc1 Replace some input devPrivates with regular struct fields
In the process, fixes a memory leak in CloseDevice, and an unchecked
memory allocation in InitializePredictableAccelerationProperties.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
2010-04-30 13:05:11 -07:00
Jamey Sharp
54e51de8cd ProcGrabButton: remove redundant error check.
If dixLookupResourceByType did not return Success, it will have set the
pointer to NULL, so the second if will always be true.

Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2010-04-26 19:24:25 -07:00
Keith Packard
e424d58123 Merge remote branch 'whot/for-keith' 2010-04-15 15:01:34 -07:00
Tim Yamin
5f31e21961 dix: fix cursor screen check for xinerama setups.
The de-duplication of CheckPhysLimits 942eae6868 added a
condition that is invalid for a Xinerama setup. pScreen is invalid for the
Xinerama case, so comparing it to anything is a bad idea.

Signed-off-by: Tim Yamin <plasm@roo.me.uk>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-04-16 07:53:14 +10:00
Peter Hutterer
9ddbb03fa5 dix: Fix crash in DeliverGrabbedEvents.
If both devices are synchronously grabbed, first with a GrabPointer, then
with a GrabKeyboard (GrabModeSync on both), sync.other of each device points
to the grab of the respective other device.

If the keyboard is then thawed through a AllowSome request, the VCK's
sync.other is reset to NULL. Subsequently, an event on the VCP would crash
the server when dereferencing sync.other on the VCP.

The check's purpose is to compare if the other device is grabbed by the same
client, which should be checked by accessing (dev->deviceGrab->grab->resource).
A check of the server-1.3 sources confirms that.

XTS test case: Xlib13 XAllowEvents 20.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-04-15 10:26:53 -07:00
Peter Hutterer
1c612acca8 dix: if owner-events is true for passive grabs, add the window mask (#25400)
A client requesting a GrabModeSync button grab, owner-events true, with only
the ButtonRelease mask set would never receive the press event even if the
grab window had the ButtonPress mask set.

The protocol requires that if owner-events is true, then the delivery mask
is the combination of the grab mask + the window event mask.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Tested-by: Jim Ramsay <i.am@jimramsay.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-03-21 15:26:28 -07:00
Daniel Stone
a2ea8c2f2c Record: Avoid duplicates from replaying frozen events
Reintroduce a check which used to be there in the old
ProcessKeyboardEvent/ProcessPointerEvent codepath, which avoids us
recording events subject to a grab twice: once when it's first processed
in EnqueueEvent, and then again when it's thawed and being replayed.

This required a tiny amount of code motion to expose syncEvents.

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>
2010-03-12 13:06:22 +10:00
Peter Hutterer
f2eacb4646 Revert "dix: Use DeliverGrabbedEvent for implicit passive grabs (#25400)"
Several users have pointed out that this commit introduces regressions, most
notably perhaps fluxbox which essentially stops working after a few clicks.

This reverts commit cf72b5437d.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-03-11 08:48:50 +10:00
Peter Hutterer
cf72b5437d dix: Use DeliverGrabbedEvent for implicit passive grabs (#25400)
A client requesting a GrabModeSync button grab, owner-events true, with only
the ButtonRelease mask set would never receive the press event even if the
grab window had the ButtonPress mask set.

The protocol requires that if owner-events is true, then the delivery mask
is the combination of the grab mask + the window event mask.

DeliverGrabbedEvents does this already for us, checking first the delivery
based on owner_events and then based on the grab mask. AFAICT, the device
cannot enter the states FREEZE_BOTH_NEXT_EVENT or FREEZE_NEXT_EVENT that
would be handled by DGE in any possible path here.

Bonus point - CheckPassiveGrabsOnWindows suddenly becomes a lot lesss
complicated.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-03-03 19:53:24 -08:00
Keith Packard
780c95caf9 Merge remote branch 'whot/for-keith' 2010-02-24 09:59:19 -08:00
Peter Hutterer
c0d9419131 dix: remove now-erroneous comment about frozen slave devices.
A direct grab on a slave device through XI2 detaches it, regardless of
whether the grab is sync or async. So this comment doesn't apply to XI2
anyway.

For XI1, aside from your life being miserable already, it doesn't matter as
XI1 does not have a concept of attachment. You can freeze a device and if
you don't freeze _all_ other devices at the same time, the master device can
still happily send events to the client.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Adam Jackson <ajax@redhat.com>
2010-02-23 11:25:55 +10:00
Eamon Walsh
0c4b75a089 Don't print a failure message when XACE denies an input event delivery.
A denial is normal and the behavior should be to drop the event.
Having the log message creates excessive log spam.

Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov>
Reviewed-by: Keith Packard <keithp@keithp.com>
2010-02-22 17:04:26 -05:00
Eamon Walsh
e687e11b12 Revert "Remove some debug messages that trigger on XACE event delivery failure."
The log messages still need to be there for non-XACE failures.

This reverts commit 4be354c4c2.

Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov>
Reviewed-by: Keith Packard <keithp@keithp.com>
2010-02-22 17:03:58 -05:00
Chris Dekter
122fc0e7a0 Re-enable RECORD extension.
RECORD was disabled during the switch to internal events. This patch
modifies the record callback to work with internal events instead of
xEvents. The InternalEvents are converted to core/Xi events as needed.

Since record is a loadable extension, the EventTo* calls must be externed.

Signed-off-by: Chris Dekter <cdekter@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-02-22 12:04:28 +10:00
Alan Coopersmith
c9726bbe31 Update Sun license notices to current X.Org standard form
Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-12-16 17:11:35 -08:00
Peter Hutterer
c20c889727 dix: fix memory leak, free event list on shutdown. (#25028)
X.Org Bug 25028 <http://bugs.freedesktop.org/show_bug.cgi?id=25028>

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2009-12-03 08:23:53 +10:00
Jeremy Huddleston
7897b6c2d4 dix: Properly detect if the other device is frozen
Signed-off-by: Jeremy Huddleston <jeremyhu@freedesktop.org>
2009-11-03 16:44:24 -08:00
Eamon Walsh
4be354c4c2 Remove some debug messages that trigger on XACE event delivery failure.
It is normal for XACE to deny an event delivery, so these log messages
shouldn't trigger when that happens.  Just drop them for now.

Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov>
2009-10-14 19:19:19 -04:00
Eamon Walsh
8502c06e19 xace: Fake return values on denials in input polling requests.
Instead of returning BadAccess when "read" permission is denied
on a device, falsify the device state (buttons down, keys pressed).
This is nicer to applications, but may still have undesired side
effects.  The long-term solution is not to use these requests in
event-driven code!

Requests affected: QueryPointer, QueryKeymap, XiQueryDevice.

Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov>
2009-10-14 19:19:19 -04:00
Peter Hutterer
72f5874434 dix: extend IsPointerDevice check to valuator-only devices.
A device with valuators but no keys is definitely a pointer device and needs
to be attached to the VCP. Otherwise, the class copying happens on the VCK
and the VCP isn't updated with the events that are to be sent through it.
This addresses the trigger for #24441, not the actual issue.
Jury is still out on valuator+key devices.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
2009-10-13 10:04:50 -07:00
Jamey Sharp
b0dd6be2c8 Cast small-int values through intptr_t when passed as pointers
On 64-bit systems, int and pointers don't have the same size, so GCC gives
warnings about casts between int and pointer types. However, in the cases
covered by this patch, it's always a value that fits in int being stored
temporarily as a pointer and then converted back later, which is safe.
Casting through the pointer-sized integer type intptr_t convinces the
compiler that this is OK.

Signed-off-by: Jamey Sharp <jamey@minilop.net>
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2009-10-08 13:38:44 +11:00
Peter Hutterer
fd91313673 dix: plug memory leak in DeviceEnterLeaveEvents.
'event' must be freed before exiting.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-09-25 08:17:02 +10:00
Peter Hutterer
90aa0e4a49 input: don't use typecasts to access members of InternalEvent.
To avoid confusion, the member names are now postfixed with _event.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-09-22 11:15:32 +10:00
Peter Hutterer
d3c66d6b69 dix: FindChildForEvent needs init child to None.
silences compiler warning:
events.c: In function 'FixUpEventFromWindow':
events.c:2262: warning: 'child' may be used uninitialized in this function

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-09-14 09:32:53 +10:00
Peter Hutterer
219ae5b628 dix: hide the sequenceNumber key repeat hack behind two functions.
Just in case we figure out a better way to do it in the future.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-09-04 12:59:43 +10:00
Daniel Stone
bfb219f532 input: allow for detectable autorepeat.
For core and XI1 events, store the key_repeat flag in the sequence number
until TryClientEvents. The sequenceNumber is unset until TryClientEvents.

[Also thrown in, some random indentation changes. Thanks]

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-09-04 12:59:41 +10:00
Daniel Stone
3d988e01e4 dix: improve code flow in TryClientEvents, better debugging messages.
Instead of a massive if (blah && blah), return early where possible.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-09-04 12:59:40 +10:00
Peter Hutterer
ef75301854 dix: FixUpEventFromWindow mustn't scramble non-device events.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-08-24 10:06:37 +10:00
Eamon Walsh
d4b8f7602b xace: fix access mode in dixLookupWindow call within ProcUngrabKey.
Referencing a window (as grab-window) only requires GetAttr access.

Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov>
2009-08-17 14:51:11 -04:00
Peter Hutterer
dca4de72d3 dix: fix potential use of unused variable 'mask'.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-08-17 10:14:20 +10:00
Peter Hutterer
6c292d1705 dix: update the sprite trace for all masters && floating slaves (#23257)
When the windows are restructured, CheckMotion needs to be called for all
masters and floating slaves to update the spriteTrace.

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

Tested-by: Thomas Jaeger
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-08-14 14:39:56 +10:00
Peter Hutterer
3abbd327f4 dix: detach SD during XI2 grabs only.
XI1 grabs on slave devices leave the device attached - just like in earlier
versions of XI.

Tested-by: Thomas Jaeger
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-08-06 10:05:12 +10:00
Peter Hutterer
c29aa7da22 Revert "dix: Remove temporary detachment of slave devices."
This reverts commit 0c0ef42292.

Tested-by: Thomas Jaeger
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-08-06 10:05:12 +10:00
Peter Hutterer
46ac9f9241 dix: pass the sourceid around for enter/leave events.
The sourceid for enter/leave events as a result of pointer motion is the ID
of the slave device. The sourceid for those as a result of a grab activating
is the device itself.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-07-30 11:04:28 +10:00
Peter Hutterer
845e65f080 xkb: move XkbFilterEvents to xkbsrv.h
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-07-30 08:43:14 +10:00
Peter Hutterer
4e9b2938cd include: untangle events.h from the SDK headers.
InternalEvents shouldn't be used anywhere outside the X server itself. Split
up into events.h for opaque typedefs for the events needed by various
headers and eventstr.h for the actual struct definitions.

eventstr.h must only be included by code that requires internal events and
is not part of the SDK.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-07-30 08:43:13 +10:00
Peter Hutterer
ecd618957e dix: fix null-pointer dereference on activating enter/focus grabs.
EventToXI2 returns a NULL event for enter/focus events since these events
aren't yet wrapped into internal events. This is a quickfix only, it works
thanks to the alignment of internal and XI2 event types.

Eventually, enter/leave events should be wrapped into internal events.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-07-22 15:27:16 +10:00
Peter Hutterer
48585bd1e3 dix: use the event mask of the grab for TryClientEvents.
A client that grabs for button/key events may not have the
ButtonPress/KeyPress mask set and should not receive an event in that case.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-07-22 12:13:05 +10:00
Peter Hutterer
9a1bfa5664 input: remove XI2 keysym grabs, use keycode grabs instead.
Keysym grabs are tricky in the details, keycode grabs are known to work. So
for now, provide keycode grabs only.

Requires inputproto 1.9.99.15.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-07-22 12:12:51 +10:00
Peter Hutterer
d040af7fa3 Update to type-specific raw events - require inputproto 1.9.99.14.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-07-15 10:36:30 +10:00
Peter Hutterer
2d35ea8d95 dix: switch to byte-counting functions.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-07-14 10:05:54 +10:00
Peter Hutterer
0c0ef42292 dix: Remove temporary detachment of slave devices.
Previously, an active grab on an attached slave device would send the device
floating for the duration of the grab. This breaks existing XI applications
(e.g. the GIMP) since they grab all devices automatically - resulting in the
loss of control over the VCP.

The behaviour of extended input devices during a grab in relation to the
core pointer is not specified in the XI protocol specification.
The removal of the temporary detachment restores the behaviour of extended
input devices as present in currently released servers - even if a device is
grabbed, an event from this device will result in an event from the core
pointer.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-07-12 21:54:35 +10:00
Eamon Walsh
00bc8d34c6 Xi: check for Use permission on the device in SetClientPointer().
Presumably, some intelligent, XI2-aware management app will be calling
XISetClientPointer on behalf of other clients; this check makes sure
the target client has permission on the device.

Requires changing the prototype to return status code instead of Bool.

Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov>
Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-06-23 20:50:29 -04:00
Peter Hutterer
5e0ca6fabd input: remove un-used "setter" argument from SetClientPointer.
It's obsolete, not likely to come back, let's drop it.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-06-12 12:37:16 +10:00
Peter Hutterer
7348bf4935 dix: set the generic event type for implicit XI2 grabs.
event->type is always GenericEvent for XI2 events. Instead, XI_ButtonPress
(the generic event's evtype must be stored.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-06-07 09:31:08 +10:00
Eamon Walsh
da682abc78 xace: fix a bad send access hook call. 2009-06-04 17:33:25 -04:00
Peter Hutterer
08fd2ae652 dix: use GetMaster in PickPointer and PickKeyboard.
GetMaster is more reliable than GetPairedDevice, it always returns the
keyboard/pointer if desired, even if the wrong device was passed in.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-06-03 12:19:05 +10:00
Peter Hutterer
2bd5ea8065 dix: rework event conversion before delivery.
Let EventToXI, EventToCore and EventToXI2 return BadMatch if there's no
matching event for this protocol spec.
Adjust the delivery paths to cope with BadMatch errors (and clean them up on
the way).

As a side-effect, this fixes server crashes on proximity events for a
grabbed device.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-06-03 11:46:30 +10:00
Peter Hutterer
fc8cfc3a05 dix: ensure EventIsDeliverable has inputMasks set at all times.
For proximity events, the XI2 type is 0 and inputMasks never got set in the
preceding condition. As a result, proximity events got never delivered.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-06-02 16:57:20 +10:00
Peter Hutterer
a66686a83e input: add support for XIAllDevices and XIAllMasterDevices passive grabs.
These grabs are suported through two fake devices inputInfo.all_devices and
inputInfo.all_master_devices. These devices are not part of the device list
and are only initialised for their device id, nothing else.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-06-02 16:02:31 +10:00
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
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
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
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
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
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
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
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
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
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
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
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
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
Peter Hutterer
6c3b633299 Merge branch 'master' into xi2 2009-04-07 19:36:27 +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
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
d9b7343eac dix: even if we don't get a XI1 event, continue processing. 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
181e41511d dix: fix up device enter/leave for XI_Enter/XI_Leave. 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
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
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
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
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
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
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
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
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
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