Commit Graph

306 Commits

Author SHA1 Message Date
Alan Coopersmith
23e83724df Fix spelling/wording issues
Most (but not all) of these were found by using
  codespell --builtin clear,rare,usage,informal,code,names
but not everything reported by that was fixed.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2020-07-05 13:07:33 -07:00
Michael Stapelberg
4f95d87d66 Xorg: honor AutoRepeat option
This option was implemented before the drivers were split in ≈2006,
and e.g. XWin still supports it.

With this commit, Xorg regains support, so that the following configuration can
be used to set the repeat rate for all keyboard devices without having to modify
Xorg command-line flags or having to automate xset(1):

Section "InputClass"
        Identifier "system-keyboard"
        MatchIsKeyboard "on"
        Option "XkbLayout" "de"
        Option "XkbVariant" "neo"
	Option "AutoRepeat" "250 30"
EndSection

Signed-off-by: Michael Stapelberg <stapelberg@google.com>
2020-04-10 16:38:17 +02:00
Jon Turney
ba59427aba Fix maybe-uninitialized warning in xf86NewInputDevice()
If SYSTEMD_LOGIND is not defined, systemd_logind_take_fd is defined as a
macro evaluating to -1 by systemd-logind.h, leaving paused
uninitialized.

../hw/xfree86/common/xf86Xinput.c: In function ‘xf86NewInputDevice’:
../hw/xfree86/common/xf86Xinput.c:919:16: warning: ‘paused’ may be used uninitialized in this function [-Wmaybe-uninitialized]
../hw/xfree86/common/xf86Xinput.c:877:10: note: ‘paused’ was declared here
2019-04-17 13:57:38 +01:00
Laurent Carlier
e790bc621b dga: #if XFreeXDGA → #ifdef XFreeXDGA
../include/events.h:32:14: error: #if with no expression

Signed-off-by: Laurent Carlier <lordheavym@gmail.com>
2018-02-19 13:14:43 -05:00
Adam Jackson
d732c36597 xfree86: Silence a new glibc warning
glibc would like to stop declaring major()/minor() macros in
<sys/types.h> because that header gets included absolutely everywhere
and unix device major/minor is perhaps usually not what's expected. Fair
enough. If one includes <sys/sysmacros.h> as well then glibc knows we
meant it and doesn't warn, so do that if it exists.

Signed-off-by: Adam Jackson <ajax@redhat.com>
2017-05-03 15:44:06 -04:00
Peter Hutterer
d13cb97442 ddx: add new call to purge input devices that weren't added
Special case for the systemd-logind case in xfree86: when we're vt-switched
away and a device is plugged in, we get a paused fd from logind. Since we
can't probe the device or do anything with it, we store that device in the
xfree86 and handle it later when we vt-switch back. The device is not added to
inputInfo.devices until that time.

When the device is removed while still vt-switched away, the the config system
never notifies the DDX. It only runs through inputInfo.devices and our device
was never added to that.

When a device is plugged in, removed, and plugged in again while vt-switched
away, we have two entries in the xfree86-specific list that refer to the same
device node, both pending for addition later. On VT switch back, the first one
(the already removed one) will be added successfully, the second one (the
still plugged-in one) fails. Since the fd is correct, the device works until
it is removed again. The removed devices' config_info (i.e. the syspath)
doesn't match the actual device we addded tough (the input number increases
with each plug), it doesn't get removed, the fd remains open and we lose track
of the fd count. Plugging the device in again leads to a dead device.

Fix this by adding a call to notify the DDX to purge any remainders of devices
with the given config_info, that's the only identifiable bit we have at this
point.

https://bugs.freedesktop.org/show_bug.cgi?id=97928

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-10-26 15:35:07 +10:00
Peter Hutterer
8fcf2fa78f xfree86: swap the list of paused devices to an xorg_list
No functional changes but it makes it easier to remove elements from the
middle of the list (future patch).

We don't have an init call into this file, so the list is manually
initialized.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-10-26 15:35:07 +10:00
Peter Hutterer
28d8855cd4 xfree86: use the right option traversal list to search for an option
They're identically laid-out structs but let's use the right type to search
for our desired value.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-10-26 15:35:07 +10:00
Peter Hutterer
f399919e13 xfree86: lock input during PreInit
This is a problem for the libinput driver that uses the same context across
multiple devices. The driver may be halfway through setting up an input device
(and the only way to do so is to add it to libinput) when the input thread
comes in an reads events. This then causes mayhem when data is dereferenced
that hasn't been set up yet.

In my case the cause was the call to libinput_path_remove_device() inside
preinit racing with evdev_dispatch_device() handling of ENODEV. The sequence
was:
- thread 2 gets an event and calls evdev_dispatch_device()
- thread 1 calls libinput_path_remove_device() which sets the device->source
  to NULL
- thread 2 reads from the fd, gets ENODEV and now removes the device->source,
  dereferencing the null-pointer

This is the one I could reproduce the most, but there are other potential
pitfalls that affect any driver that uses the same fd for multiple devices.
Avoid all this and wrap PreInit into the lock.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2016-08-12 14:43:08 +10:00
Peter Hutterer
dd4e21cb3a xfree86: fix unbalanced input_lock/unlock in xf86NewInputDevice()
If a device couldn't be enabled we left the lock hanging.

This patch also removes the leftover OsReleaseSignals() call, now unnecessary.
Note that input_unlock() is later than previously OsReleaseSignals().
RemoveDevice() manipulates the input device and its file descriptors, it's
safer to put the input_unlock() call after RemoveDevice() to avoid events
coming in while the device is being removed.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2016-08-12 14:41:19 +10:00
Peter Hutterer
7f2d690725 xfree86: if ATTR_KEYBOARD is set, match for keyboards
ATTR_KEY maps to ID_INPUT_KEY which is set for any device with keys.
ID_INPUT_KEYBOARD and thus ATTR_KEYBOARD is set for devices that are actual
keyboards (and have a set of expected keys).

Hand-written match rules may only apply ID_INPUT_KEYBOARD, so make sure we
match on that too.

Arguably we should've been matching on ATTR_KEYBOARD only all along but
changing that likely introduces regressions.

Reported-by: Marty Plummer <netz.kernel@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-07-18 16:40:46 -04:00
Eric Biggers
da9fec4edd Allow ConstantDeceleration < 1.0
As documented in xorg.conf(5), a value of ConstantDeceleration between 0
and 1 will speed up the pointer.  However, values less than 1 actually
had no effect.  Fix this.

Note that this bug only affected "ConstantDeceleration" as configured
through xorg.conf, not "Device Accel Constant Deceleration" as configured
through xinput.  The property handler AccelSetDecelProperty() also did
not need to be changed, as it did not limit the values of the property.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=92766

Signed-off-by: Eric Biggers <ebiggers3@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-06-10 10:54:48 +10:00
Peter Hutterer
c69bd15e00 Allow compile-time selection of a fallback input driver
A new --with-fallback-input-driver=foo option allows selecting a
fallback driver for the server if the driver configured for the device
is not found.  Note that this only applies when the device has a driver
assigned and that module fails to load, devices without a driver are
ignored as usual.

This avoids the situation where a configuration assigns e.g. the
synaptics driver but that driver is not available on the system,
resulting in a dead device. A fallback driver can at least provides some
functionality.

This becomes more important as we move towards making other driver true
leaf nodes that can be installed/uninstalled as requested. Specifically,
wacom and synaptics, a config that assigns either driver should be
viable even when the driver itself is not (yet) installed on the system.

It is up to the distributions to make sure that the fallback driver is
always installed. The fallback driver can be disabled with
--without-fallback-input-driver and is disabled by default on non-Linux
systems because we don't have generic drivers on those platforms.
Default driver on Linux is libinput, evdev is the only other serious
candidate here.

Sample log output:
[  3274.421] (II) config/udev: Adding input device SynPS/2 Synaptics TouchPad (/dev/input/event4)
[  3274.421] (**) SynPS/2 Synaptics TouchPad: Applying InputClass "touchpad weird driver"
[  3274.421] (II) LoadModule: "banana"
[  3274.422] (WW) Warning, couldn't open module banana
[  3274.422] (II) UnloadModule: "banana"
[  3274.422] (II) Unloading banana
[  3274.422] (EE) Failed to load module "banana" (module does not exist, 0)
[  3274.422] (EE) No input driver matching `banana'
[  3274.422] (II) Falling back to input driver `libinput'
.. server proceeds to assign libinput, init the device, world peace and rainbows
everywhere, truly what a sight. Shame about the banana though.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-06-08 13:08:32 -04:00
Keith Packard
6a5a4e6037 Remove SIGIO support for input [v5]
This removes all of the SIGIO handling support used for input
throughout the X server, preparing the way for using threads for input
handling instead.

Places calling OsBlockSIGIO and OsReleaseSIGIO are marked with calls
to stub functions input_lock/input_unlock so that we don't lose this
information.

xfree86 SIGIO support is reworked to use internal versions of
OsBlockSIGIO and OsReleaseSIGIO.

v2: Don't change locking order (Peter Hutterer)
v3: Comment weird && FALSE in xf86Helper.c
    Leave errno save/restore in xf86ReadInput
    Squash with stub adding patch (Peter Hutterer)
v4: Leave UseSIGIO config parameter so that
    existing config files don't break (Peter Hutterer)
v5: Split a couple of independent patch bits out
    of kinput.c (Peter Hutterer)

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-05-26 16:07:54 -07:00
Peter Hutterer
2285fe78c0 xfree86: add support for MatchIsTabletPad
The tablet pads have been separate kernel devices for a while now and
libwacom has labelled them with the udev ID_INPUT_TABLET_PAD for over a year
now. Add a new MatchIsTabletPad directive to apply configuration options
specifically to the Pad part of a tablet.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2016-05-03 16:15:51 +10:00
Laércio de Sousa
daa6d2d58f config/udev: distinguish between real keyboards and other key devices
This patch introduces a new flag ATTR_KEY for hotplugged input devices,
so we can better distinguish between real keyboards (i.e. devices with
udev property ID_INPUT_KEYBOARD="1") and other key input devices like
lid switches, power buttons, etc.

All supported hotplug backends (udev, hal, and wscons) will set both
flags ATTR_KEY and ATTR_KEYBOARD for real keyboards, but udev backend
will set ATTR_KEY, but not ATTR_KEYBOARD, for non-keyboard key input
devices (hal and wscons will set both flags in any case). With this
distinction, kdrive input hotplugging mechanism will be allowed to only
grab real keyboards, as other key input devices are currently not
supported.

In order to don't break current behaviour, this patch will replace all
ATTR_KEYBOARD occurrences with ATTR_KEY in hw/xfree86/common/xf86Xinput.c.

[ajax: Just add ATTR_KEY, don't re-number the other attributes]

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Laércio de Sousa <laerciosousa@sme-mogidascruzes.sp.gov.br>
2016-03-01 10:46:48 -05:00
Peter Hutterer
f3593918a0 xfree86: move check for driver->PreInit up
No real change, but if the driver is broken and doesn't provide a PreInit
function, then we don't need to worry about logind.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2015-12-21 07:15:30 +10:00
Peter Hutterer
fc4fbe8224 xfree86: add NoMatchFoo directives for InputClass sections
InputClass sections use various MatchFoo directives to decide which device to
apply to. This usually works fine for specific snippets but has drawbacks for
snippets that apply more generally to a multitude of devices.

This patch adds a NoMatchFoo directive to negate a match, thus allowing
snippets that only apply if a given condition is not set. Specifically, this
allows for more flexible fallback driver matching, it is now possible to use a
snippet that says "assign driver foo, but only if driver bar wasn't already
assigned to it". For example:

Section "InputClass"
   Identifier "libinput for tablets"
   MatchIsTablet "true"
   NoMatchDriver "wacom"
   Driver "libinput"
EndSection

The above only assigns libinput to tablet devices if wacom isn't already
assigned to this device, making it possible to select a specific driver by
installing/uninstalling it.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2015-12-18 11:56:46 +10:00
Peter Hutterer
71ba826901 xfree86: fix minor memory leak
xf86*StrOption returns a strdup

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-11-24 07:53:20 +10:00
Peter Hutterer
da10d0cb42 dix: hook up the unaccelerated valuator masks
If present, access the unaccelerated valuator mask values for DGA and XI2 raw
events.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-05-20 12:44:58 +10:00
Alan Coopersmith
4cb1034906 Convert hw/xfree86 to new *allocarray functions
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2015-04-21 16:58:08 -07:00
Peter Hutterer
f485a1af64 Drop valuator mask argument from GetKeyboardEvents
Nothing was using it and if anyone had they would've gotten a warning and
noticed that it doesn't actually work. Drop this, it has been unused for years.

Input ABI 22

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2015-03-13 12:31:21 +10:00
Peter Hutterer
732fd7e571 Drop trailing whitespaces
sed -i "s/[ ]\+$//g" **/*.(c|h)

happy reviewing...
git diff -w is an empty diff.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-11-12 10:25:00 +10:00
Peter Hutterer
15460eaed2 systemd-logind: let the logind code decided whether to close an fd
We can only request one fd per device from systemd-logind. If a fd is re-used
by the same device, releasing the fd from one device doesn't mean we can close
it. The systemd code knows when it's really released, so let it close the fd.

Test case: xorg.conf section for an input device with hotplugging enabled.
evdev detects the duplicate and closes the hotplugged device, which closes the
fd. The other instance of evdev thinks the fd is still valid so now you're
playing a double lottery. First, which client(s) will get the evdev fd?
Second, which requests will be picked up by evdev and which ones will be
picked up by the client? You'll never know, but the fun is in finding out.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2014-05-05 07:26:33 +10:00
Alan Coopersmith
bf087659f0 Add necessary headers for major()/minor() on Solaris to xf86Xinput.c
Without these, after commit fdb4ec86c2, it fails to build on Solaris,
with errors of:
xf86Xinput.c: In function 'xf86stat':
xf86Xinput.c:816:5: error: implicit declaration of function 'major' [-Werror=implicit-function-declaration]
xf86Xinput.c:817:5: error: implicit declaration of function 'minor' [-Werror=implicit-function-declaration]

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
2014-03-22 14:42:09 -07:00
Hans de Goede
2b77b208da xf86Xinput: release server managed fd before removing the device from the list
So that the fd in use test in systemd_logind_release_fd works properly.

Note we cannot change the test inside systemd_logind_release_fd as it must
work for devices which were never added to the xf86InputDevs too.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-03-13 13:11:55 +01:00
Peter Hutterer
fdb4ec86c2 xfree86: handle xorg.conf devices with logind
Only devices from the config backend have their attributes set, devices from
the xorg.conf only have Option "Device". That option is also set by the
config backend, so use it.

And since the config backend sets our major/minor but xorg.conf devices don't
have that set, make sure we try to stat it first where needed.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2014-03-11 17:43:30 +10:00
Hans de Goede
687afa3f64 systemd-logind: Add delayed input device probing
With systemd-logind we cannot probe input devices while switched away, so
if we're switched away, put the pInfo on a list, and probe everything on
that list on VT-Enter.

This is using an array grown by re-alloc, rather than a xorg_list since
creating a new data-type to store a pInfo + list-entry just for this seems
overkill.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-03-03 08:13:55 +01:00
Hans de Goede
cac3921989 systemd-logind: Hookup systemd-logind integration
This commits makes the changes necessary outside of the systemd-logind core
to make the server use systemd-logind managed fds for input devices and drm
nodes.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-03-03 08:13:55 +01:00
Hans de Goede
3346166a65 xf86Xinput: Modify API for server-managed fd support
With systemd-logind support, the xserver, rather than the drivers will be
responsible for opening/closing the fd for input devices.

This commit adds a new capabilities field to the InputDriverRec and a
XI86_DRV_CAP_SERVER_FD flag for drivers to indicate that they support server
managed fds.

This commit adds a new XI86_SERVER_FD flag to indicate to drivers when the
server is managing the fd and they should not open/close it. Note that even
if drivers declare they support server managed fds there is no guarantee they
will actually get them.

Since this changes the input driver ABI, this commit bumps it.

systemd-logind tracks devices by their chardev major + minor numbers, since
we are breaking ABI anyways also add major and minor fields for easy storage /
retrieval of these.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-03-03 08:13:54 +01:00
Peter Hutterer
14fb6cf92c Revert "xfree86/common: handle string constants in xf86Xinput configuration"
This reverts commit 22592855e9.

What warning was this supposed to fix?

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2014-02-04 11:27:48 +10:00
Keith Packard
60014a4a98 Replace 'pointer' type with 'void *'
This lets us stop using the 'pointer' typedef in Xdefs.h as 'pointer'
is used throughout the X server for other things, and having duplicate
names generates compiler warnings.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-01-12 10:24:11 -08:00
Keith Packard
22592855e9 xfree86/common: handle string constants in xf86Xinput configuration
Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2014-01-12 10:14:50 -08:00
Keith Packard
e1e01d2e33 xfree86/common: Warning fixes. Mostly const string handling.
Also removes DPMS functiosn from Xext/dpmsproc.h

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2014-01-12 10:14:48 -08:00
Dave Airlie
5b359cf613 xf86: use new xf86VTOwner interface in a few places
This replaces some previous uses of direct xf86Screens[0] accesses.

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Dave Airlie <airlied@gmail.com>
2013-04-12 10:01:20 +10:00
Marcin Slusarz
2d4fda4b09 xfree86: fix mouse wheel support for DGA clients
xf86-input-evdev (since "smooth scrolling" support was added) can send mouse
motion and wheel events in one batch, so we need to handle it properly.
Otherwise mouse wheel events which come with motion events are lost
and separate mouse wheel events are handled through non-DGA path.

Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-05-23 16:06:27 +10:00
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
Alan Coopersmith
ca64912c02 Namespace list api to reduce conflicts with similar system headers
Rename functions/macros from list_* to xorg_list_*
Rename struct from struct list to struct xorg_list.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
In-sed-I-trust: Peter Hutterer <peter.hutterer@who-t.net>
2012-02-03 14:23:24 -08:00
Peter Hutterer
75953ccb9e xfree86: split warning about missing identifier or input driver
Check for identifier first and bail if it's missing (also remove the current
identifier check after we've already bailed due to missing identifiers)

If a driver is missing, warn but also say that we may have added this device
already. I see too many bugreports with incorrectly shortened log files.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Cyril Brulebois <kibi@debian.org>
2012-01-05 11:10:33 +10:00
Daniel Stone
098b837440 Add the touch input API stubs
xf86PostTouchEvent is the driver API to submit touch events to the server.
This API doesn't do anything yet though but now we can at least bump the
API.

For valuators, drivers should use the existing xf86InitValuatorAxisStruct
function.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2011-12-19 09:08:36 +10:00
Alan Coopersmith
6e6d732bac Convert strncpy/strncat to strlcpy/strlcat
As long as we're carrying around a compatibility copy in os/strl*.c,
might as well use them.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-11-23 12:15:05 -08:00
Peter Hutterer
35ec24cf24 input: replace remaining GetPairedDevice() with GetMaster()
Wherever it's obvious which device we need (keyboard or pointer), use
GetMaster() instead of GetPairedDevice(). It is more reliable in actually
getting the device type we want.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-11-09 13:26:47 +10:00
Keith Packard
d91aa0e660 Merge remote-tracking branch 'whot/two-screen-coordinates' 2011-11-02 21:20:07 -07:00
Peter Hutterer
63e87b8639 xfree86: reduce calls to input_option_get_key/value
No functional changes.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
2011-10-31 09:39:04 +10:00
Peter Hutterer
c39c8d3428 input: switch InputOption to use XF86OptionRec storage.
Use the same struct for both InputOption and XF86OptionRec so we don't need
to convert to and fro the two in the config backends.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-10-25 14:06:39 +10:00
Peter Hutterer
9cbfa4739a xfree86: remove xf86XInputSetScreen
Keeping track of which screen the pointer within the input driver is
obsolete now. To bind to a screen, use the transformation matrix instead.

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-10-13 11:07:50 +10:00
Keith Packard
6378d0233d Merge remote-tracking branch 'herrb/master' 2011-10-03 13:56:06 -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
8d1a414cca input: switch InitValuatorAxisStruct to return Bool
Return errors instead of silently ignoring them.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-09-29 12:26:43 +10:00
Peter Hutterer
4b4caecb7d xfree86: expose Option "TransformationMatrix"
Recent changes to the server change the default absolute input device
behaviour on zaphods to span the whole desktop too. Since these setups
usually use an xorg.conf, allow the transformation matrix to be specified in
the config as well.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Simon Thum <simon.thum@gmx.de>
2011-09-27 11:57:25 +10:00