Commit Graph

10866 Commits

Author SHA1 Message Date
Peter Hutterer
fcafe82575 Add null-terminated list interface.
This is a set of macros to provide a struct list-alike interface for classic
linked lists such as the XF86OptionRec or the DeviceIntRec. The typical
format for these is to have a "struct foo *next" pointer in each struct foo
and walk through those. These macros provide a few basic functions to add to,
remove from and iterate through these lists.

While struct list is in some ways more flexible, switching legacy code to
use struct list is not alway viable. These macros at least reduce the amount
of open-coded lists.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-08-22 15:56:53 +10:00
Peter Hutterer
79ca7c0b57 xfree86: comment typo fix
in synch → in sync

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-08-22 15:56:53 +10:00
Peter Hutterer
2bfb802839 dix: don't XWarpPointer through the last slave anymore (#38313)
This line was introduced pre-1.6 to fix Bug 19297. The effect of warping
through the VCP then was that if a device had custom valuator ranges, the
warp position would be wrong. The better device for this effect is the the
XTest device.

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

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

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-08-22 15:56:53 +10:00
Nobuhiro Iwamatsu
b29ce0726d Disable check of double-aligned in test/input.c on Renesas SH
Renesas SH is not aligned at size of double.
When structure has double value, It is aligned in 4byte (long).

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

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

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

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

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

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

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

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

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-08-22 15:56:52 +10:00
Peter Hutterer
6fd2adc179 mi: fix compiler warnings ("foo" set but not used)
misprite.c: In function 'miSpriteSaveUnderCursor':
misprite.c:940:12: warning: variable 'y' set but not used
[-Wunused-but-set-variable]
misprite.c:940:9: warning: variable 'x' set but not used
[-Wunused-but-set-variable]

mivaltree.c: In function 'miComputeClips':
mivaltree.c:226:10: warning: variable 'resized' set but not used
[-Wunused-but-set-variable]

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-08-22 15:56:52 +10:00
Peter Hutterer
484cef5b29 Xi: silence compiler warnings (set but not used)
exevents.c: In function 'UpdateDeviceState':
exevents.c:719:9: warning: variable 'bit' set but not used
[-Wunused-but-set-variable]

exevents.c: In function 'ProcessOtherEvent':
exevents.c:889:22: warning: variable 'v' set but not used
[-Wunused-but-set-variable]
exevents.c:888:17: warning: variable 'k' set but not used
[-Wunused-but-set-variable]

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

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-08-22 15:56:51 +10:00
Peter Hutterer
dbbe5735d1 test: add a test for GetMaster() behaviour
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-08-22 15:56:51 +10:00
Peter Hutterer
b3c76b0c53 mi: fix comment typo, whitespace in miPointerSetPosition
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-08-22 15:56:51 +10:00
Peter Hutterer
c9562bed0d dix: rename mieqSwitchScreen argument fromDix → set_dequeue_screen, document
fromDIX is neither exactly true nor particularly helpful in understanding
what this parameter triggers. Rename to set_dequeue_screen, because that's
exactly what happens.

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

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

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-08-22 15:56:50 +10:00
Peter Hutterer
20a61845d3 config: use add_option for '_source' too
_source was being allocated manually, with all other options added to that
list through add_option. Skip the manual part, allocate the first option
_source with add_option too.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-08-22 15:56:50 +10:00
Peter Hutterer
d33652dad8 config: return the new InputOption from add_option.
Change add_option to return the new InputOption on success, or NULL
failure. This way we can at least check for errors in callers.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-08-22 15:56:50 +10:00
Peter Hutterer
e684e816ac config: fix a log message
PRODUCT was taken from the parent, hence ppath.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-08-22 15:56:49 +10:00
Peter Hutterer
1357cd7251 Revert "Attempt to add the 'mouse' driver in more situations."
This reverts commit 43d9edd31e.

This commit was introduced in the 1.2 cycle when hotplugging was less than
ideal (i.e. it didn't exist). From the commit message:

    Always add a mouse driver instance configured to send core events, unless
    a core pointer already exists using either the mouse or void drivers.  This
    handles the laptop case where the config file only specifies, say,
    synaptics, which causes the touchpad to work but not the pointing stick.
    We don't double-instantiate the mouse driver to avoid the mouse moving twice
    as fast, and we skip this logic when the user asked for a void core pointer
    since that probably means they want to run with no pointer at all.

To get this case above, a user would need to disable hotplugging _and_ have a
xorg.conf that only references one device. This is possible, but not a use-case
we should worry about too much now.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-08-22 15:56:49 +10:00
Lennart Poettering
159b03e137 config: add udev/systemd multi-seat support
Add support for multi-seat-aware input device hotplugging. This
implements the multi-seat scheme explained here:

http://www.freedesktop.org/wiki/Software/systemd/multiseat

This introduces a new X server switch "-seat" which allows configuration
of the seat to enumerate hotplugging devices on. If specified the value
of this parameter will also be exported as root window property
Xorg_Seat.

To properly support input hotplugging devices need to be tagged in udev
according to the seat they are on. Untagged devices are assumed to be on
the default seat "seat0". If no "-seat" parameter is passed only devices
on "seat0" are used. This means that the new scheme is perfectly
compatible with existing setups which have no tagged input devices.

Note that the -seat switch takes a completely generic identifier, and
that it has no effect on non-Linux systems. In fact, on other OSes a
completely different identifier scheme for seats could be used but still
be exposed with the Xorg_Seat and -seat.

I tried to follow the coding style of the surrounding code blocks if
there was any one could follow.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-08-22 15:56:49 +10:00
Peter Hutterer
95772598b5 xfree86: use xf86AllocateInput for implicit devices too
Slowly merging the vastly different code-paths.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-08-22 15:56:49 +10:00
Peter Hutterer
fa8f465281 xfree86: factor out adding/removing a device from the input device array
No functional changes, just readability improvements. This also gets rid of
the count variable. Count was just used for resizing the null-terminated
list. Since we're not in a time-critical path here at all we can afford to
loop the list multiple times instead of keeping an extra variable around.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-08-22 15:56:49 +10:00
Peter Hutterer
5b5477c05f xfree86: update comment for InitInput
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-08-22 15:56:48 +10:00
Peter Hutterer
7354f60783 xfree86: nest loops instead of 0x1 pointers.
If we find the core device, move all other device pointers forward right
then and there. The break will jump out of the top loop.

They had a special on braces today, so I added some for readability (and
fixed up tab vs space indentation.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-08-22 15:56:48 +10:00
Peter Hutterer
5669aa2d24 xfree86: improve readability of synthesized device.
No functional changes.

The options we assign are the ones from the Pointer/Keyboard device so we
might as well use those readable names instead of dev[count-1]->options.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-08-22 15:56:48 +10:00
Peter Hutterer
5aa826cdd1 test: add a option duplication test
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-08-22 15:56:48 +10:00
Peter Hutterer
4527e2b776 xfree86: when implicitly choosing a core device, set the option to a value
Devices are core pointers/keyboards by default now anyway, but let's set the
option to some value instead of just NULL.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-08-22 15:56:47 +10:00
Peter Hutterer
44d53728a6 xfree86: don't warn about duplicate core devices
It doesn't matter. All devices are core pointer devices by default now
anyway.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-08-22 15:56:47 +10:00
Daniel Kurtz
033f53c223 xf86Helper: use LogHdrMessageVerb in xf86VDrvMsgVerb
LogHdrMessageVerb allows passing a parameterized header to insert in a log
message between MessageType and the formatted message body string.

Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-08-22 15:56:44 +10:00
Daniel Kurtz
cd8ee3e5cb xf86Helper: use LogHdrMessageVerb in xf86VIDrvMsgVerb
LogHdrMessageVerb allows passing a parameterized header to insert in a log
message between MessageType and the formatted message body string.

Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-08-22 15:49:25 +10:00
Daniel Kurtz
b31d104fc0 os/log: Add LogVHdrMessageVerb and friends
LogVHdrMessageVerb allows a custom header to be inserted in a log message,
between the Log system's MessageType string, and a formatted variable
message body. The custom header can itself be a formatted variable string.

These functions can be used, for example, by driver abstraction layers to
format specific driver messages in a standard format, but do it in a way
that is efficient, obeys the log-layers verbosity settings, and is safe
to use in signal handlers (because they don't call malloc), even for
types besides X_NONE.

Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-08-22 15:49:18 +10:00
Daniel Kurtz
b82f934db6 os/log: Pull LogMessageTypeVerbString out of LogVMessageVerb
Also, optimize how the type and format strings are combined.

Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
Reviewed-by: Guillem Jover <guillem@hadrons.org>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-08-22 15:48:14 +10:00
Michel Dänzer
4020cab88f EXA/mixed: Update sys_pitch in MPH even when there's no system memory copy.
Otherwise sys_pitch will be stale when a system memory copy is allocated.

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=38322 and a crash when
unlocking the screen with xscreensaver, reported by Janne Huttunen.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Tested-by: Janne Huttunen <jahuttun@gmail.com>
Tested-by: Jan Kriho <Erbureth@gmail.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-08-10 09:30:08 -07:00
Julien Cristau
a1dec7cd6a Xephyr/dri: register screen and window privates on init
Fixes assertion failure when calling dixSetPrivate
Debian bug#632549 <http://bugs.debian.org/632549>

Reported-and-tested-by: Mohammed Sameer <msameer@foolab.org>
Signed-off-by: Julien Cristau <jcristau@debian.org>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-08-09 13:51:21 -07:00
Keith Packard
39bc81b60d Version bumped to 1.10.99.902 (1.11 RC2)
At the close of the 1.11 non-critical fixes window.

Signed-off-by: Keith Packard <keithp@keithp.com>
2011-08-03 20:57:03 -07:00
Ville Syrjälä
9504caf1c3 composite: Inhibit window background paint with manual subwindow redirection
The composite extension spec says that window background painting
should be inhibited when the subwindow redirection mode is set to
manual.

This eliminates the ugly flashing effect when compiz unredirects a
fullscreen window.

Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com>
Reviewed-by: Owen Taylor <otaylor@fishsoup.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-08-03 20:46:36 -07:00
Pierre-Loup A. Griffais
f1d75f3b74 Revert "composite: Don't backfill non-MapWindow allocations"
This reverts commit db8840600e.

It was an optimization for the resize case, but 193ecc8b45 made
it so that no backfilling takes place on resize if left in.

Signed-off-by: Pierre-Loup A. Griffais <pgriffais@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>

Conflicts:

	composite/compalloc.c
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-08-03 20:40:17 -07:00
Julien Cristau
e87adcc9e0 Xquartz: include new localization files in the tarball
Signed-off-by: Julien Cristau <jcristau@debian.org>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-07-31 16:45:55 -07:00
Jeremy Huddleston
a1bb5062c7 XQuartz: xpr: Don't FatalError if xp_unlock_window fails
We added the FatalError in 5d1d9d9ae3 but
it caused a regression http://xquartz.macosforge.org/trac/ticket/482

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-07-31 16:44:56 -07:00
Jeremy Huddleston
c319f7b5b3 XQuartz: Use CFSTR to avoid implicit cast warning of NSString * to CFStringRef
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-07-31 16:44:55 -07:00
Aaron Plattner
08dfff92e8 randr: Compare all the bytes in RRPostPendingProperties
RRPostPendingProperties tries to compare the pending and current
property values to decide whether they're actually changing.  However,
it does this using a memcmp that passes in pending_value->size as the
number of bytes.  This is actually the number of elements, where each
element is (pending_value->format / 8) bytes long.  This causes the
pending value to not be propagated if the first pending_value->size
bytes are the same and only the end of it is changing.

Fix this by computing the total number of bytes to compare in the
memcmp.

Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-07-29 16:41:53 -07:00
Keith Packard
b8f61c11c9 Merge remote-tracking branch 'whot/for-keith' 2011-07-29 14:58:58 -07:00
Peter Hutterer
f51e42f583 Terminate the log with one last message.
Instead of just closing the log when everything is done, put one more
message in stating that we're actually terminating. Users or scripts that
look at the Xorg.log will then know that a) the server has terminated
properly and b) why the server terminated (to some degree, given that most
real-world errors will be caused by AbortServer()).

Acked-by: Gaetan Nadon <memsize@videotron.ca>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Tested-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Tested-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-07-27 09:31:02 +10:00
Julien Cristau
01de08c7d2 configure: set default xkb rules to evdev on Linux
If config/udev was enabled, this would default to base, which means that
after regen the devices would get the wrong rules, and hilarity would
ensue.

It's probably safe to default to evdev unconditionally on Linux by now.

Reported-by: Bastian Blank <waldi@debian.org>
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>
2011-07-27 09:31:02 +10:00
Peter Hutterer
3798dd379c Initialize the fd to -1 for xorg.conf input devices.
For hotplugged devices, xf86AllocateInput does that for us but the xorg.conf
path is different. Since not all drivers reset the fd during PreInit but may
still call close(pInfo->fd) in all cases, this can terminate the logging
early.

Reproducible: add a wacom driver InputDevice section with no Option Device.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-07-27 09:31:02 +10:00
Peter Hutterer
f2a6735cfc xfree86: NULL option values are technically valid, don't strdup them
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-07-27 09:31:02 +10:00
Peter Hutterer
f0d7e9db28 xfree86: duplicate xorg.conf device information before xf86NewInputDevice
xf86ConfigLayout.inputs contains the information from the xorg.conf
file. Passing this into xf86NewInputDevice means the device will get
cleaned up on exit and the pointers in xf86ConfigLayout.inputs are left
dangling. In the second server generation, this results in a server
crash.

Also, rename pDev to pInfo. pDev is pretty much reserved for DeviceIntPtr
types.

Reproducible: AutoAddDevices off and xorg.conf input sections, trigger
server regeneration.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-07-27 09:31:02 +10:00
Peter Hutterer
8ffddbcf72 xfree86: Remove devices that failed to enable on startup
Devices that succeeded during PreInit and DEVICE_INIT but failed in
DEVICE_ON would be deleted through xf86DeleteInput but not removed from the
list of input devices (and not turned off). The result was a double free on
server shutdown.

Fix this by calling RemoveDevice if EnableDevice fails.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-07-27 09:31:01 +10:00