Commit Graph

129 Commits

Author SHA1 Message Date
Keith Packard
9838b7032e Introduce a consistent coding style
This is strictly the application of the script 'x-indent-all.sh'
from util/modular. Compared to the patch that Daniel posted in
January, I've added a few indent flags:

	-bap
	-psl
	-T PrivatePtr
	-T pmWait
	-T _XFUNCPROTOBEGIN
	-T _XFUNCPROTOEND
	-T _X_EXPORT

The typedefs were needed to make the output of sdksyms.sh match the
previous output, otherwise, the code is formatted badly enough that
sdksyms.sh generates incorrect output.

The generated code was compared with the previous version and found to
be essentially identical -- "assert" line numbers and BUILD_TIME were
the only differences found.

The comparison was done with this script:

dir1=$1
dir2=$2

for dir in $dir1 $dir2; do
	(cd $dir && find . -name '*.o' | while read file; do
		dir=`dirname $file`
		base=`basename $file .o`
		dump=$dir/$base.dump
		objdump -d $file > $dump
	done)
done

find $dir1 -name '*.dump' | while read dump; do
	otherdump=`echo $dump | sed "s;$dir1;$dir2;"`
	diff -u $dump $otherdump
done

Signed-off-by: Keith Packard <keithp@keithp.com>
Acked-by: Daniel Stone <daniel@fooishbar.org>
Acked-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2012-03-21 13:54:42 -07:00
Dave Airlie
8d3731a811 hal: free tmp_val in one missing case
Pointed out by coverity scan.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-12-06 16:01:50 +00:00
Keith Packard
6378d0233d Merge remote-tracking branch 'herrb/master' 2011-10-03 13:56:06 -07:00
Lennart Poettering
fad04dd970 udev: make use of udev_enumerate_add_match_tag() only when it is available
udev_enumerate_add_match_tag() and udev_monitor_filter_add_match_tag()
are mostly optimizations, hence simply skip these calls if they are not
available in the installed version of libudev.

This should fix the build on older versions of udev.

[airlied: fixes tinderbox failures on RHEL6]

Signed-off-by: Lennart Poettering <lennart@poettering.net>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Tested-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-10-03 11:55:36 -07:00
Matthieu Herrb
f54852edc3 Add a 'wscons' autoconf mechanism to configure input devices on BSD.
This does not really handle hotplug (it's handled inside the kernel,
by the 'mux' devices), but uses the wscons console driver
configuration to figure out the keyboard layout and the list of
pointing devices found by the kernel.

Signed-off-by: Matthieu Herrb <matthieu.herrb@laas.fr>
Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-09-30 10:10:32 +02:00
Peter Hutterer
05284a03f9 input: make InputOption opaque, provide interface functions.
InputOptions is not switched to use struct list for a future patch to unify
it with the XF86OptionRec.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
2011-08-22 15:56:53 +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
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
Lennart Poettering
6cea28fe4b config: don't fail if a device vanished by the time we managed to look at it
The nature of hotplug is that a device we enumerated might already be
gone by the time we look at it, so don't assume otherwise.

Signed-off-by: Lennart Poettering <lennart@poettering.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-07-27 09:29:56 +10:00
Lennart Poettering
f13de9ca1b config: limit the kernel subsystems we look for devices in
Don't enumerate/monitor all devices of the system (since that can be
quite a few), but limit our search to devices from the "input"
subsystem, as well as the "tty" subsystem (to cover Wacom tablets).

This should make X start up a bit faster and reduce the number of
unnecessary wake-ups of the X server.

Signed-off-by: Lennart Poettering <lennart@poettering.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-07-27 09:29:49 +10:00
Lennart Poettering
882e3c2680 config: process udev "changed" and "add" events in the same code paths
udev gives no guarantee that before each "changed" event for a device
there's an "add" event, or that before each "remove" is an "add", or
that before each "add" there was no "add" already and so on. Users can
trigger these events at any time with "udevadm trigger", and netlink is
a lossy transport, hence the events can come in unexpected ordering.

With other words: regardless which event is generated, the X server must
not choke on it and make the best of it, hence make sure that if we get
an "add" event for an existing device we don't add the device a second
time.

Signed-off-by: Lennart Poettering <lennart@poettering.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-07-27 09:29:39 +10:00
Erkki Seppälä
6243332782 config: handle device change event properly
wakeup_handler in udev.c wasn't dealing with udev change events.
There are situations when a device can gain its input capabilities
after it has been added to the system and therefore the change events
must be handled as well.

The change is handled as a consecutive device removal and addition.

Signed-off-by: Erkki Seppälä <erkki.seppala@vincit.fi>
Signed-off-by: Stefan Kost <Stefan.Kost@nokia.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-03-24 09:51:09 +10:00
Rami Ylimäki
4114533db6 config: Ensure that stolen option list elements are released.
NewInputDeviceRequest steals the contents of option list elements but
doesn't use the elements themselves for anything. Therefore the list
elements need to be released always.

Signed-off-by: Rami Ylimäki <rami.ylimaki@vincit.fi>
Reviewed-by: Erkki Seppälä <erkki.seppala@vincit.fi>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-03-09 07:59:41 +10:00
Pauli Nieminen
3e1455505a udev: Fix removing of the wake up handler
RemoveBlockAndWakeupHandlers requires caller to pass same block data
parameter as for RegisterBlockAndWakeupHandlers.

Signed-off-by: Pauli Nieminen <ext-pauli.nieminen@nokia.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2010-12-31 12:52:51 +00:00
Daniel Stone
22796cfa48 udev: Add strdups to kill const warnings
InputAttributes wants non-const members, and while it appears safe to
cast it, just leave it be for the moment.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
2010-12-31 12:36:44 +00:00
Alan Coopersmith
3a9bb93dd1 Convert alloc+sprintf pairs into asprintf() & XNFasprintf() calls
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net>
2010-12-07 11:10:35 -08:00
Alan Coopersmith
03e8bfa1d1 Convert existing Xprintf style calls to asprintf style
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net>
2010-12-07 11:10:35 -08:00
Dan Horák
ecdbe817fd XF86CONFIGDIR is undefined when built with --disable-xorg (#28672)
The 10-evdev.conf file gets installed as /usr/share/X11/10-evdev.conf on
platforms that built the server with --disable-xorg like s390/s390x. The
definition/installation should be guarded with "if XORG" because it makes
sense only when built with xorg.

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

Signed-off-by: Dan Horák <dan@danny.cz>
Acked-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-11-19 11:11:04 +10:00
Peter Hutterer
88cb61e1e5 Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver into input-api
Conflicts:
	dix/getevents.c
	hw/xfree86/common/xf86Xinput.h

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-11-11 12:54:46 +10:00
Peter Hutterer
cbaa6a66e0 config: remove mention of AllowEmptyInput
"You will probably want to add the following option to the ServerFlags of
your xorg.conf:
         Option "AllowEmptyInput" "True""

I can't imagine why you would want to do that. My life is painful enough
already.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
2010-11-11 10:26:44 +10:00
Peter Hutterer
eaf0b6a4d8 Merge branch 'master' into input-api
Conflicts:
	config/udev.c
	hw/xfree86/common/xf86Helper.c
	hw/xfree86/common/xf86Module.h
	hw/xfree86/common/xf86Xinput.h
	hw/xfree86/os-support/linux/lnx_init.c

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-10-15 13:46:59 +10:00
Peter Hutterer
31c71425ac config: expose config_info as an input option.
config_info is the only reliable indicator we have in the server for
duplicate devices (drivers can test for maj/min on fds as well). Don't set
this after the device has been initialized but assume it's important enough
to set during NIDR.

This makes the option "config_info" available to the drivers as well.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2010-09-01 15:26:46 +10:00
Chase Douglas
7925e89456 Fix udev population of Bluetooth input device product IDs
The udev device_added function takes the vendor and model IDs of added
devices and converts them into an attribute that can be matched for by
an InputClass configuration using MatchUSBID. Currently, the udev
mechanism works for USB devices, but fails to work properly for
Bluetooth devices. The product IDs of the event node are actually the
IDs of the Bluetooth receiver instead of the device.

This patch reads the product ID from the PRODUCT property of the parent
of the added device. This tag is set correctly for both USB and
Bluetooth input devices. The following devices have been tested by
specifying individual InputClass sections in xorg.conf:

* Apple Keyboard (Bluetooth)
* Apple Magic Trackpad (Bluetooth)
* Apple Magic Mouse (Bluetooth)
* Microsoft Bluetooth Notebook Mouse 5000 (Bluetooth)
* Microsoft IntelliMouse Optical (USB)
* N-Trig Touchscreen (USB)
* Wacom Bamboo Touch (USB)

Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-09-01 15:04:37 +10:00
Mikhail Gusarov
6e7417c342 config: Replace xstrdup with strdup in add_option()
All callers of add_option pass string literal as "key" argument
except one, where non-NULL condition is guarded by if().

Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2010-06-11 19:05:46 +07:00
Mikhail Gusarov
6592db6bb5 Get rid of xstrdup when argument is definitely non-NULL
Replace xstrdup with strdup when either constant string is
being duplicated or argument is guarded by conditionals and
obviously can't be NULL

Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2010-06-11 19:04:23 +07:00
Peter Hutterer
7805e45284 config: remove redundant DBUS API define, require dbus-1 >= 1.0
It's still being pulled in by the HAL CFLAGS but the requirement to define
this was dropped from DBus pre 1.0 (November 2006).
This means we require dbus 1.0 now.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
2010-06-11 09:47:25 +10:00
Dan Nicholson
8426259286 config: Script to convert HAL fdi settings to InputClass sections
In the new world of udev and InputClass, x11_* settings from HAL fdi
files will not be honored. This script converts those settings into
valid InputClass sections that can be dropped into xorg.conf.d.

Signed-off-by: Dan Nicholson <dbn.lists@gmail.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-06-11 09:31:38 +10:00
Dan Nicholson
87a1507da7 xfree86: Match devices based on USB ID
Sometimes the vendor and product names aren't specific enough to target
a USB device, so expose the numeric codes in the ID. A MatchUSBID entry
has been added that supports shell pattern matching when fnmatch(3) is
available. For example:

	MatchUSBID "046d:*"

The IDs are stored in lowercase hex separated by a ':' like "lsusb" or
"lspci -n".

Signed-off-by: Dan Nicholson <dbn.lists@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-06-11 09:30:33 +10:00
Dan Nicholson
645679c152 xfree86: Match devices based on PnP ID
Serial input devices lack properties such as product or vendor name. This
makes matching InputClass sections difficult. Add a MatchPnPID entry to
test against the PnP ID of the device. The entry supports a shell pattern
match on platforms that support fnmatch(3). For example:

	MatchPnPID "WACf*"

A match type for non-path pattern matching, match_pattern, has been added.
The difference between this and match_path_pattern is the FNM_PATHNAME
flag in fnmatch(3).

Signed-off-by: Dan Nicholson <dbn.lists@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-06-11 09:30:07 +10:00
Dan Nicholson
61c35d8ac4 config/hal: Missing newline in log message
Signed-off-by: Dan Nicholson <dbn.lists@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-06-10 14:33:08 +10:00
Dan Nicholson
697c5b010d config/udev: Add verbose info when fetching udev properties
Give the user a chance to see why their input devices are being ignored,
even if they have to start the server with -logverbose.

Signed-off-by: Dan Nicholson <dbn.lists@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-06-10 14:33:02 +10:00
Dan Nicholson
94547b2d14 config/hal: don't leak the input.tags property
Signed-off-by: Julien Cristau <jcristau@debian.org>
Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-06-10 14:32:57 +10: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
Keith Packard
4e9d3e4132 Revert "Add a "flags" field to DeleteInputDeviceRequest."
Peter wants to get a larger patch sequence put together and I didn't
read past the commit message to see the 'don't take this patch
please'.

This reverts commit 531ff40301.
2010-05-26 07:54:35 -07:00
Peter Hutterer
531ff40301 Add a "flags" field to DeleteInputDeviceRequest.
Some input drivers need to implement an internal hotplugging scheme for
dependent devices to provide multiple X devices off one kernel device file.
Such dependent devices can be added with NewInputDeviceRequest() but they are
not removed when the config backend calls DeleteInputDeviceRequest(),
leaving the original device to clean up.

Example of the wacom driver:

config/udev calls NewInputDeviceRequest("stylus")

wacom PreInit calls
        NewInputDeviceRequest("eraser")
        NewInputDeviceRequest("pad")
        NewInputDeviceRequest("cursor")
        PreInit finishes.

When the device is removed, the config backend only calls
DeleteInputDeviceRequest for "stylus". The driver needs to call
DeleteInputDeviceRequest for the dependent devices eraser, pad and cursor to
clean up properly.
However, when the server terminates, DeleteInputDeviceRequest is called for
all devices - the driver must not remove the dependent devices to avoid
double-frees. There is no method for the driver to detect why a device is
being removed, leading to elaborate guesswork and some amount of wishful
thinking.

Though the input driver's UnInit already supports flags, they are unused.
This patch uses the flags to supply information where the
DeleteInputDeviceRequest request originates from, allowing a driver to
selectively call DeleteInputDeviceRequest when necessary.

Also bumps XINPUT ABI.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-05-25 17:47:32 -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
Dan Nicholson
d4dd3d0085 Move 10-evdev.conf to system config dir $datadir/X11/xorg.conf.d
Since the server searches in a vendor specific path now, we can install
the evdev catchall there without disturbing local administration files.

Signed-off-by: Dan Nicholson <dbn.lists@gmail.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-04-08 15:21:01 +10:00
Peter Hutterer
c8a608cb6c config: only match sane devices in 10-evdev.conf
Having a generic catchall also adds devices like accelerometers. These
devices make X unusable, hence restrict matching to "known sane" devices
like pointers, touchpads, keyboards, tablets and touchscreens.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Julien Cristau <jcristau@debian.org>
Acked-by: Dan Nicholson <dbn.lists@gmail.com>
Acked-by: James Cloos <cloos@jhcloos.com>
2010-04-08 15:21:00 +10:00
Keith Packard
24952b7866 Install 10-evdev.conf in $(prefix)/etc/X11/xorg.conf.d under udev
udev needs some xorg.conf file to tell it to load a suitable input
driver, 10-evdev.conf is as simple as they come, mapping all evdev
devices to the evdev driver.

Signed-off-by: Keith Packard <keithp@keithp.com>
2010-04-01 23:59:36 -07:00
Dan Nicholson
aa91508356 config/udev: Prefer product name from attribute rather than uevent
The input device product name for evdev devices in the kernel uevent has
embedded quotes that aren't expected here. Use the sysfs name attribute
instead, which does not suffer this problem. The uevent name will be
used as a fallback if no name attribute is found.

Signed-off-by: Dan Nicholson <dbn.lists@gmail.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-03-26 15:30:57 +10:00
Thomas Jaeger
8490500770 udev: Don't filter subsystem "input"
This allows serial wacom devices to work, whose subsystem is "tty".

Signed-off-by: Thomas Jaeger <ThJaeger@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-02-15 15:27:42 +10:00
Peter Hutterer
c6d9bc092c Add tag matching to input attributes.
Tags may be a list of comma-separated strings that match against a MatchTag
InputClass section. If any of the tags specified for a device match against
the MatchTag of the section, this match is evaluated true and passed on to
the next match condition.

Tags are specified as "input.tags" (hal) or "ID_INPUT.tags" (udev), the
value of the tags is case-sensitive and require an exact match (not a
substring match).

i.e. "quirk" will not match "QUIRK", "need_quirk" or "quirk_needed".

Example configuration:
udev:
    ENV{ID_INPUT.tags}="foo,bar"

hal:
    <merge key="input.tags" type="string">foo,bar</merge>

xorg.conf:
    Section "InputClass"
            Identifier "foobar quirks"
            MatchTag "foo|foobar"
            Option "Foobar" "on"
    EndSection

Where the xorg.conf section matches against any device with the tag "foo"
or tag "foobar" set.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Tested-by: Dan Nicholson <dbn.lists@gmail.com>
Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
2010-02-11 19:25:49 +10:00
Julien Cristau
435f27667f config: add libudev input-hotplug backend
Add a backend using libudev for input hotplug, and disable the hal and
dbus backends if this one is enabled.

XKB configuration happens using xkb{rules,model,layout,variant,options}
properties (case-insensitive) on the device.  We fill in InputAttributes
to allow configuration through InputClass in Xorg.

Requires udev 148 for the input_id helper and ID_INPUT* properties.

Signed-off-by: Julien Cristau <jcristau@debian.org>
Acked-by: Dan Nicholson <dbn.lists@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-12-30 19:05:44 +00:00
Dan Nicholson
0711598dd3 config: Introduce InputAttributes in NewInputDeviceRequest
In order to give NewInputDeviceRequest more information, a new
InputAttributes type is introduced. Currently, this collects the product
and vendor name, device path, and sets booleans for attributes such as
having keys and/or a pointer. Only the HAL backend fills in the
attributes, though.

Signed-off-by: Dan Nicholson <dbn.lists@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
2009-12-22 23:24:13 -08:00
Peter Hutterer
49046088f1 config: don't shutdown the libhal ctx if it failed to initialize (#23213)
Regression introduced by b1c3dc6ae2.
Shutting down the libhal_ctx if the init failed may cause an abort.
This can happen if hald is not yet running at server startup.

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

Tested-by: Stefan Dirsch
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-08-14 11:01:20 +10:00
Rémi Cardona
b1c3dc6ae2 config: add HAL error checks
This patch simplifies error handling in the HAL code and fixes a
segfault if libhal_find_device_by_capability() failed.

Fixes http://bugs.gentoo.org/278760

Based on a patch by Martin von Gagern <Martin.vGagern@gmx.net>

Signed-off-by: Rémi Cardona <remi@gentoo.org>
Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-07-28 11:58:45 +02:00
Simon Thum
21ee53060b config: fix build after XI2 API changes to RemoveDevice.
This patch fixes the build with --enable-config-dbus is enabled
(default disabled).

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-06-07 20:35:14 +10:00
Alan Coopersmith
1e816065e5 Don't printf NULL pointers on HAL connection error
Fixes Solaris bug 6801386 Xorg core dumps on startup if hald not running
http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=6801386

Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
2009-05-08 21:31:01 -07:00