summaryrefslogtreecommitdiff
path: root/dix
AgeCommit message (Collapse)AuthorFilesLines
2011-06-01DIX: Set backgroundState correctly for root windowMarko Macek1-0/+2
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-05-25Don't call pixman_disable_out_of_bounds_workaround() anymoreSøren Sandmann Pedersen1-2/+0
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-25xserver: remove AbsoluteClass, breaking the A(P|B)ISimon Thum1-9/+0
This struct was unused and has been effectively removed in commit 633b81e8ba09cc6a1ea8b43f323874fda2cf0bde 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-24input: Don't implicitly define verify_internal_eventJeremy Huddleston1-3/+4
Fixes regression introduced by 56901998020b6f443cbaa5eb303100d979e81b22 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-24input: Fix format string for verify_internal_eventJeremy Huddleston1-1/+1
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-14XQuartz: Don't call mieqEnqueue during server shutdownJeremy Huddleston1-9/+16
Found-by: GuardMalloc Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-05-13dix: replace CORE_EVENT and XI2_EVENT macros with inline functions.Peter Hutterer1-29/+49
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jamey Sharp <jamey@minilop.net>
2011-05-13dix: use a tmp variable instead of multiple rClient(other).Peter Hutterer1-4/+5
no functional changes. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jamey Sharp <jamey@minilop.net>
2011-05-13dix: return deliveries from DeliverGrabbedEventPeter Hutterer1-1/+5
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-13dix: move the grab activation condition into a if block.Peter Hutterer1-16/+14
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-13dix: split out client delivery from DeliverEventsToWindowPeter Hutterer1-43/+87
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-13dix: split out window owner event delivery from DeliverEventsToWindowPeter Hutterer1-20/+55
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-13dix: split implicit grab activation into a separate function.Jamey Sharp1-41/+50
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-11dix: replace unneded goto with break.Peter Hutterer1-1/+1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-05-11input: remove DDX event list handlingPeter Hutterer2-30/+19
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-11input: replace EventListPtr with InternalEvent arrayPeter Hutterer2-65/+42
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-11input: Provide Queue{Button|Keyboard|Proximity}Event helpersPeter Hutterer1-0/+80
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-06Input: Simplify CheckPassiveGrabsOnWindow loopDaniel Stone1-111/+105
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-06Input: Make CheckPassiveGrabsOnWindow take InternalEventDaniel Stone1-18/+54
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-06input: change CHECKEVENT macro to verify_internal_event functionPeter Hutterer2-2/+30
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-05input: Only release SD buttons for explicit floating/reattachment (#36146)Peter Hutterer1-3/+1
Grabbing an SD device temporary floats the device but we must not release the buttons. Introduced in commit 9d23459415b84606ee4f38bb2d19054c432c8552 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-03Input: Fix event size confusion in CheckPassiveGrabsOnWindowDaniel Stone1-1/+1
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-03Input: Add DeepestSpriteWin functionDaniel Stone1-2/+2
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-03Input: Pass co-ordinates by reference to transformAbsoluteChase Douglas1-14/+14
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-03Move event filter initializer out of the structure itselfAlan Coopersmith1-9/+8
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-04-24dix: remove duplicated includesNicolas Kaiser2-2/+0
Remove duplicated includes. Signed-off-by: Nicolas Kaiser <nikai@nikai.net> Reviewed-by: Matthieu Herrb <matthieu.herrb@laas.fr>
2011-04-21dix: improve control flow in QueryTrackersPeter Hutterer1-8/+8
If the velocity is 0, skip the remainder. If we're not in range, skip the remainder. No functional change. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jamey Sharp <jamey@minilop.net>
2011-04-21dix: rename a bunch of variables to be more self-explanatoryPeter Hutterer1-19/+20
i → used_offset iveloc → initial_velocity res → result vdiff → velocity_diff vfac → velocity_factor tmp → tracker_velocity Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Simon Thum <simon.thum@gmx.de>
2011-04-21dix: reduce scope of tmp and mult.Peter Hutterer1-1/+4
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Simon Thum <simon.thum@gmx.de>
2011-04-21dix: reduce the work done by ApplySofteningPeter Hutterer1-15/+16
We can modify fdx/fdy in-place rather than requiring dx/dy as well. And the decision to soften can be made in the caller (unless decided by the velocity state). Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Simon Thum <simon.thum@gmx.de>
2011-04-21dix: split softening and constant deceleration into two functionsPeter Hutterer1-5/+10
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Simon Thum <simon.thum@gmx.de>
2011-04-21dix: use single return statement in ApplySimpleSofteningPeter Hutterer1-6/+7
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Simon Thum <simon.thum@gmx.de>
2011-04-21dix: rename od, d to prev_delta, deltaPeter Hutterer1-9/+9
And res to result. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Simon Thum <simon.thum@gmx.de>
2011-04-21dix: Don't use short as boolPeter Hutterer1-1/+1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Simon Thum <simon.thum@gmx.de>
2011-04-21dix: rename "res" to "result" for improved readabilityPeter Hutterer1-9/+9
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Simon Thum <simon.thum@gmx.de>
2011-04-21dix: change ProcessVelocityData2D to BOOL.Peter Hutterer1-1/+1
Don't confuse users with a return type of short, that's even less indicative that it returns 0/non-0 than "int". Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Jamey Sharp <jamey@minilop.net>
2011-04-21dix: add some more documentation to ptraccel codePeter Hutterer1-4/+13
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Simon Thum <simon.thum@gmx.de>
2011-04-21dix: don't pass the index for a tracker around, pass the trackerPeter Hutterer1-10/+11
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Simon Thum <simon.thum@gmx.de>
2011-04-21dix: CalcTracker only uses the tracker, thus only pass the tracker.Peter Hutterer1-6/+4
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Simon Thum <simon.thum@gmx.de> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-04-21dix: use single return statement in DoGetDirectionPeter Hutterer1-42/+49
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Simon Thum <simon.thum@gmx.de>
2011-04-21dix: use single return value in GetDirectionPeter Hutterer1-9/+8
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Simon Thum <simon.thum@gmx.de>
2011-04-21dix: document GetDirectionPeter Hutterer1-1/+7
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Simon Thum <simon.thum@gmx.de>
2011-04-21dix: document DoGetDirection's mathsPeter Hutterer1-2/+10
This is the best explanation I can come up with, but it seems to hold true for my example values. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Simon Thum <simon.thum@gmx.de>
2011-04-21dix: improve comment, directions flagged are 45° eachPeter Hutterer1-1/+1
The two directions returned by this calculation are always the two boundary conditions. Since we don't do quadrants but octants, the flagged ones are 45° each. e.g. an angle of 35° flags E and NE. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-04-21dix: improve readbility of DoGetDirection.Peter Hutterer1-12/+25
Use enums for the direction bits, not hardcoded bitfield values that are added up. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Simon Thum <simon.thum@gmx.de>
2011-04-21dix: only use a single return where only one is needed.Peter Hutterer1-2/+2
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Simon Thum <simon.thum@gmx.de>
2011-04-21dix: fix typo in direction calculationPeter Hutterer1-1/+1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Simon Thum <simon.thum@gmx.de>
2011-04-21dix: silence compiler warningPeter Hutterer1-1/+1
resource.c: In function 'AddResource': resource.c:493:3: warning: format '%lx' expects type 'long unsigned int', but argument 3 has type 'RESTYPE' RESTYPE is uint32_t, not long. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-04-18input: remove GetKeyboardValuatorEvents, this is now unnecessary.Peter Hutterer2-18/+5
GetKeyboardValuatorEvents handles NULL valuator masks already, so the GetKeyboardEvents wrapper is not needed. Rename GKVE to GKE. 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-04-18Xi: fix valuator alignment in DeepCopyDeviceClasses (#36119)Peter Hutterer1-10/+37
commit 678f5396c91b3d0c7572ed579b0a4fb62b2b4655 only fixed the initialization, not the copy. After a slave device change, the valuator were out of alignment again. X.Org Bug 36119 <http://bugs.freedesktop.org/show_bug.cgi?id=36119> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>