Commit Graph

1261 Commits

Author SHA1 Message Date
Oldřich Jedlička
993e78d6c4 Fix typo in updateSlaveDeviceCoords
The index [0] for the second valuator looks bogus; fix it.

Signed-off-by: Oldřich Jedlička <oldium.pro@seznam.cz>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-02-01 15:27:42 +10:00
Tiago Vignatti
60b6477f6d dix/configure: remove null root cursor option
The default behavior of the server is to start with an invisible root cursor.
Be such cursor invisible or inexistent (null), in the end it doesn't matter -
for the user. The content on screen will be the same. Besides, there's no
difference, in terms of performance, whether such cursor is invisible or
simply null. The paths that both take inside the server are roughly the same.

Therefore create a null root cursor becomes irrelevant.

Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-01-27 21:28:57 -08:00
Peter Hutterer
b4baab90c0 dix: EventToCore needs to copy the root window too.
This value isn't actually set for normal events but it saves us some work
for the record extension support.

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-01-27 14:38:16 -08:00
Keith Packard
27fc98ecfe Revert "dix: EventToCore needs to copy the root window too."
This reverts commit 0f2d297ded.

Peter provided an updated patch which fixes the tests.
2010-01-27 14:37:32 -08:00
Tiago Vignatti
d9c20ee419 dix: move cursor realize code to its own function
The semantic remains, only code was moved: reuse chunk of code to realize
cursor on both AllocARGBCursor and AllocGlyphCursor.

Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-01-25 09:40:23 +13:00
Peter Hutterer
0f2d297ded dix: EventToCore needs to copy the root window too.
This value isn't actually set for normal events but it saves us some work
for the record extension support.

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-01-25 09:02:29 +13:00
Peter Hutterer
6f265d55a6 dix: don't update the slave coordinates from the VCK.
A keyboard event from a device with both valuators and keys will be posted
through the VCK. In this case, do not update the slave device coordinates
from the VCK - they're always 0/0. Leave them as-is, for the next pointer
event will continue where it left.

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-01-05 14:01:51 -08:00
Alan Coopersmith
13c8bd3fde CloseDevice: call XkbRemoveResourceClient before freeing key class struct
XkbRemoveResourceClient() returns immediately if dev->key is NULL.
CloseDevice calls XkbRemoveResourceClient until it removes all resources.

If we free dev->key and NULL it before XkbRemoveResourceClient, then
infinite loop ensues, and the server appears to hang on exit or crash.

Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-01-04 18:48:18 -08:00
Simon Thum
1763550d01 dix: add smooth limited pointer acceleration profile
This profile is inspired by the accel code removed from the wacom driver.
It ascends from zero to acceleration, maxing out at threshold. This means you
can control the slope using threshold, which wasn't possible in wacom.
For sanity's sake, threshold should grow with acceleration.

Works best with adaptive deceleration, since otherwise it only generates
acceleration above 1, causing seldom pixel skips.

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-01-01 11:22:42 -08:00
Alan Coopersmith
895f40792a Add type name argument to CreateNewResourceType
Convert all calls of CreateNewResourceType to pass name argument

Breaks DIX ABI.

ABI versions bumped:

Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2009-12-18 17:44:12 -08:00
Keith Packard
0cb638dc68 Merge remote branch 'alanc/master' 2009-12-16 21:58:44 -08: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
Jeremy Huddleston
ed7d252719 dtrace: Add Xserver-dtrace.h to CLEANFILES
Signed-off-by: Jeremy Huddleston <jeremyhu@freedesktop.org>
Reviewed-by: Alan Coopersmith <alan.coopersmith@sun.com>
2009-12-15 16:51:48 -08:00
Keith Packard
d3e054ac07 Merge remote branch 'jeremyhu/master' 2009-12-11 09:22:22 -08:00
Julien Cristau
3fad969a90 Move config_init() after CreateWellKnownSockets() and InitCoreDevices()
config_init() can now add devices directly instead of scheduling a
timer.

Signed-off-by: Julien Cristau <jcristau@debian.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-12-11 11:37:36 +10:00
Jeremy Huddleston
1b8f90aa8b Miscellaneous compilation warning fixes
main.c:134: warning: no previous prototype for 'dix_main'
rootlessScreen.c: In function 'RootlessMarkOverlappedWindows':
rootlessScreen.c:434: warning: function declaration isn't a prototype
backtrace.c:51: warning: format '%lx' expects type 'long unsigned int', but argument 5 has type 'int'
backtrace.c:54: warning: format '%lx' expects type 'long unsigned int', but argument 5 has type 'int'
set.c: In function 'RecordSetMemoryRequirements':
set.c:413: warning: old-style function definition
set.c: In function 'RecordCreateSet':
set.c:425: warning: old-style function definition
stub.c: In function ‘main’:
stub.c:236: warning: ISO C90 forbids mixed declarations and code

Signed-off-by: Jeremy Huddleston <jeremyhu@freedesktop.org>
2009-12-08 15:50:28 -08:00
Peter Hutterer
66bb8c6fbd dix: remove core devices when shutting down. (#25028)
NewInputDeviceRequest (and RemoveDevice) have checks in place to not allow
removal of the VCP/VCK. When shutting down, they need to be cleaned up
nonetheless to free the memory associated.

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:24:04 +10:00
Peter Hutterer
83d90b90bc dix: remove some obsolete comment.
The "counterpart to biggest hack" included checking for the motion history
function - which is unified in 1.7. Hence the check (which is already
removed) would evaluate to true anyway, and this comment isn't needed.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2009-12-03 08:24:03 +10: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
Peter Hutterer
0e6cee853d dix: clean up accel old scheme data when switching schemes.
InitValuatorClassDeviceStruct always initializes with the default profile.
The default profile allocs data and adds a few properties which become
obsolete if the profile is changed lateron by the driver.

The property handlers are stored in the device's devPrivates and cleaned up.
Ideally, the property handler ID's could be stored somewhere more obvious,
but that seems to require breaking the ABI.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Simon Thum <simon.thum@gmx.de>
2009-11-25 10:57:07 +10:00
Gaetan Nadon
c739beb439 .gitignore: use common defaults with custom section #24239
Using common defaults will reduce errors and maintenance.
Only the very small or inexistent custom section need periodic maintenance
when the structure of the component changes. Do not edit defaults.

Reviewed-By: Jeremy Huddleston <jeremyhu@apple.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2009-11-11 21:40:20 -08:00
Peter Hutterer
982f6648fd dix: increase default number of buttons to 10.
Currently the XTEST device is limited to the same number of buttons the core
device has. This breaks if a user has a mouse with more than 3 buttons
connected and is using a core client to fake button 8+ presses.

Rather than expecting all clients to fix themselves, just increase the
default number of buttons to 10, which is somewhat a compromise. Ideally,
the XTEST devices should adjust themselves to the highest number of buttons
available on the slave devices (like the master pointers already do), but
that's a taks for another day.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
2009-11-10 18:33:01 -08:00
Keith Packard
7442f3355a Merge remote branch 'jeremyhu/master' 2009-11-04 08:55:20 -08:00
Rami Ylimaki
0573042cdd dix: Fixes a memory leak when a cursor resource is released.
Just open and close a client that creates cursors in order to
reproduce. In the problem case bits->refcnt is -1 and therefore
bits->devPrivates is never released.

Signed-off-by: Rami Ylimaki <ext-rami.ylimaki@nokia.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2009-11-04 08:26:18 -08: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
Adam Jackson
15b30fde17 dix: Fix up colormap fixup.
FindClientResourcesByType() will walk all colormaps on all screens; we
only want to fix up the current screen.  Otherwise, screens > 0 will
have the visual pointers for their colormaps pointing off into space.

Signed-off-by: Adam Jackson <ajax@redhat.com>
2009-10-23 09:46:30 +09:00
Jon TURNEY
909df9beb3 Resolve an inconsistency between libX11 and Xserver over GetModifierMapping
libX11 ModMap.c believes that GetModifierMapping can never return an error

Xserver devices.c believes that GetModifierMapping can return an error if
the ModMap couldn't be generated

According to the protocol document I have, libX11 is right, so adjust the
server to send back an empty modmap if one couldn't be made...

http://bugs.freedesktop.org/show_bug.cgi?id=24621

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
2009-10-22 10:32:25 +09:00
Yaakov Selkowitz
7c31dd5db8 Remove CopyISOLatin1Lowered
This function was moved verbatim into libXfont-1.4, and it is not used
by the server or any drivers.  Exporting it in both places leads to
multiple definition linking errors on Cygwin, where we need to use a
static libXfont due to poor weak-symbol handling.

Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
2009-10-15 08:08:23 -07: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
Alan Coopersmith
c0a1bb511a Fix make warning: overriding commands for target `dix.O'
Not only does automake generate unnecessary rules for dix.O on platforms
for which SPECIAL_DTRACE_OBJECTS is false, it generates duplicate sets
when "if SPECIAL_DTRACE_OBJECTS" is nested inside "if XSERVER_DTRACE"

Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
2009-10-08 08:56:52 -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
Francisco Jerez
4151a13c80 dix: Fix a double free in dixFreePrivates.
It can be reproduced when the server is regenerated and for some
reason the private keys are reassigned in a different order: a
manually allocated private may get an index formerly used by a
preallocated private. In that case it will first be manually freed and
then again by dixFreePrivates, as items[i].size was never zeroed
out. Do it in dixResetPrivates.

Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Acked-by: Eamon Walsh <ewalsh@tycho.nsa.gov>
Signed-off-by: Keith Packard <keithp@keithp.com>
2009-10-07 16:22:46 -07:00
Alan Coopersmith
315aaef557 Use $(AM_V_GEN) to silence more commands when AM_SILENT_RULES is active
Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Dan Nicholson <dbn.lists@gmail.com>
Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-10-06 19:40:20 -07:00
Alan Coopersmith
4b0911565d Add platform tests for Dtrace linker magic
Replaces special handling for Xquartz DDX and scales better to handling
the multiple platforms that now have some level of Dtrace support available.

Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2009-10-06 19:40:19 -07:00
Peter Hutterer
45f447dafd dix: force a minimum of 0 for screen coordinates.
Currently the root coordinates may fall into ]-1..0] if the subpixel
remainder is less than 0. Screen coordinates mustn't go below 0, so use
miPointerSetPosition to cap off the remainder if the coordinates are below
0.

This is cheating a bit, a more comprehensive solution to deal with subpixels
correctly when crossing screens is needed. For now, this'll do.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Simon Thum <simon.thum@gmx.de>
2009-10-02 12:16:47 +10:00
Kim Woelders
4970666827 dix: Fix potential memory corruption in doListFontsWithInfo.
Signed-off-by: Kim Woelders <kim@woelders.dk>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-09-30 10:21:29 +10:00
Dave Airlie
6ffda5aae7 dix/glx/composite: consolidate visual resize in one place.
The previous code was copied and in both cases incorrectly fixed
up the colormaps after resizing the visuals, this patch consolidates
the visual resize + colormaps fixups in one place. This version
also consolidates the vid allocation for the DepthPtr inside the
function.

I'm not 100% sure colormap.[ch] is the correct place for this but
visuals are mostly created in fb and I know thats not the place to
be resizing them.

Fixes fd.o bug #19470.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-09-30 10:00:07 +10:00
Ben Byer
efacd7bfd0 Add (ok, fix) support for DTrace under OS X
(cherry picked from commit 8428a57184)
2009-09-27 23:32:19 -07:00
Alan Coopersmith
e23bffc41b Fix build of unit tests when dtrace probes are enabled
ar loses the dtrace probe magic when building static libraries, so we
have to link with the .O files in order to resolve the dtrace probe symbols.

Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
2009-09-24 16:36:25 -07: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
Thomas Jaeger
5402f18d9c dix: report XI1 axis values correctly if first_valuator != 0
Signed-off-by: Thomas Jaeger <ThJaeger@gmail.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-09-24 14:52:15 +10:00
Simon Thum
824a09d856 dix: move bounds check before access
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-09-22 16:26:14 +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
Keith Packard
8b5086250a Eliminate bogus event resizing.
Now that all event queues hold internal events only, they never need
to be resized. Resizing them led to memory corruption as they would
get sized for an appropriate xEvent, not an internal event.

Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-09-20 20:45:24 +10:00
Peter Hutterer
ec0ad408ef xfree86: use SendDevicePresenceEvents instead of manual event handling.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-09-18 08:23:33 +10:00
Rémi Cardona
f56cbe1ef2 dix: append "built-ins" to the font path in SetDefaultFontPath
49b93df8a3 made the hard dependency on
a "fixed" font go away but only Xorg could use the built-ins fonts by
default.

With this commit, all DDXs get "built-ins" appended to their FontPath, not
just Xorg.

Tested with Xorg, Xvfb and Xnest.

Signed-off-by: Rémi Cardona <remi@gentoo.org>
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Tested-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-09-16 11:44:08 +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
744cdc8977 dix: Remove two _X_EXPORT defines from the function definition.
These two are defined _X_EXPORT in their declaration anyway.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-09-10 09:48:00 +10:00