Commit Graph

11027 Commits

Author SHA1 Message Date
Peter Hutterer
401150d7dc input: change pointer screen crossing behaviour for multiple ScreenRecs
miPointerSetPosition traditionally took coordinates on a per-screen basis,
triggering a screen switch when these went out-of-bounds. For absolute
devices, this prevented screen crossing in the negative x/y direction.

This patch changes the event generation patch to handle screen coordinates
in a desktop range (i.e. all screens together). Screen switches are
triggered when these coordinates are not on the current screen.

This unifies the pointer behaviour of single ScreenRec multihead and
multiple ScreenRecs multihead in that the cursor by default moves about the
whole screen rather than be confined to one single screen. The
transformation matrix may then be used to actually confine the cursor to the
screen again.

Note: fill_pointer_events has to deal with several different coordinate
systems. Make sure you read the comment before trying to understand the code.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-10-13 11:34:43 +10:00
Peter Hutterer
6bd0eff40f dix: extend rescaleValuatorAxis to take a minimum default
Allow rescaling to non-zero based axis ranges as default (for when screen
offsets are non-zero). Currently unused.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-10-13 11:34:17 +10:00
Peter Hutterer
8bebb4b489 Store desktop dimensions in screenInfo.
For Zaphod mode screen crossing handling we need to know the size of all
screens together (i.e. the whole desktop size). Store that in the screenInfo to
have it readily available in events.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-10-13 11:26:09 +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
Peter Hutterer
32b289e46c dix: move MD last.valuator update into fill_pointer_events
Don't update the MD where it's not expected, positionSprite should really
just do that - position the sprite.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-10-11 12:07:00 +10:00
Peter Hutterer
3b36fd1b49 mi: switch miPointerSetPosition to take doubles
Don't switch between doubles and ints in the caller, instead take doubles in
miPointerSetPosition and do the conversion there. For full feature we should
change everything down from here for doubles too.

Functional change: previously we'd restore the remainder regardless of
screen switching/confinement (despite what the comment said). Now,
screen changing or cursor constraints will cause the remainder be clipped
off. This should happen for cursor constraints but arguably not for screen
crossing.

This also corrects a currently wrong comment about miPointerSetPosition's
input coordinates.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-10-11 12:06:56 +10:00
Peter Hutterer
81cfe44b1e mi: return the screen from miPointerSetPosition
miPointerSetPosition may switch screens. Always return the screen the sprite
is on instead of relying on callers to call miPointerGetScreen().

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-11 12:06:53 +10:00
Peter Hutterer
88dfe5366d dix: drop screen argument from positionSprite
We can just get this in the function, no effective functional changes.

Also return the screen to the caller. Though we don't use it yet, we will in
a follow-up patch.

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-11 12:06:50 +10:00
Peter Hutterer
967bc25da2 dix: move screen- to device coordinate scaling to separate function
No functional changes.

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-11 12:06:48 +10:00
Peter Hutterer
b059e06e19 dix: don't allow keyboard devices to submit motion or button events.
GPE unconditionally dereferences pDev->valuator if a mask is present. This
shouldn't really happen but if it does, don't crash, just ignore the events
with an error.

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-11 12:06:42 +10:00
Peter Hutterer
bccff53318 dix: moveRelative modifies parameter in-place, say so.
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-11 12:06:38 +10:00
Peter Hutterer
b966362ccf dix: rename moveAbsolute to clipAbsolute
Let's be honest about what it does.

moveRelative accumulates delta _and_ clips in some cases, so that one can
keep it's name.

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-11 12:06:34 +10:00
Peter Hutterer
959d18c376 dix: fix missing verb in comment
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-11 12:06:29 +10:00
Peter Hutterer
7074ec87bd dix: document transformAbsolute
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-11 12:06:27 +10:00
Peter Hutterer
f4ca19ce3a dix: copy the source ID into the RawEvent (#34240)
X.Org Bug 34240 <http://bugs.freedesktop.org/show_bug.cgi?id=34240>

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-10-10 10:49:10 +10:00
Max Schwarz
765ef69295 dix: fix inverted handling of legacy scroll button events
This bug led to inverted scrolling axes with drivers that support smooth
scrolling axes but send legacy button events.

Signed-off-by: Max Schwarz <Max@x-quadraht.de>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-10-06 10:55:16 +10:00
Peter Hutterer
911e7368bf Move pointOnScreen to inpututils.c
We need this from other files too.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-10-04 13:01:33 +10:00
Peter Hutterer
d0a7cd759d dix: NewCurrentScreen must work on pointers where possible
When a screen switch is triggered by PointerKeys, the device for
NewCurrentScreen is the keyboard. Submitting pointer events for this
keyboard (without valuators) has no effect as GPE ignores the event.

Force the dequeuing through the XTest device attached to this device.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-10-04 13:00:26 +10:00
Peter Hutterer
535b3789be dix: warn about keyboard events with valuator masks
We don't actually handle the mask correctly. They're clipped and dropped
into the event but that's about it. I don't think we did since 1.4, let's
warn the user if this happens.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-10-04 13:00:23 +10:00
Peter Hutterer
9537afb13f dix: fill out root_x/y for keyboard events
Switching screens relies on rootx/y to be set to the correct value. Note:
though we technically take a mask for GetKeyboardEvents we don't actually
handle it properly to move the pointer as required (and generate motion
events if needed).

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-10-04 13:00:21 +10:00
Keith Packard
6378d0233d Merge remote-tracking branch 'herrb/master' 2011-10-03 13:56:06 -07:00
Keith Packard
6e965d8a18 Merge remote-tracking branch 'koba/reviewed' 2011-10-03 13:47:49 -07:00
Gaetan Nadon
466e4b3f17 Xserver-spec: use appropriate copyright markup
Use docbook copyright markup for year and holder.

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-10-03 12:19:58 -07:00
Gaetan Nadon
62940bf38f Xserver-spec: re-order markup to follow outpout order
No content change, no layout/ordering change.
It is easier to find <title> at the top.

Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-10-03 12:19:56 -07:00
Gaetan Nadon
365bc2f5b1 Xserver-spec: add release information
It has been added in all docs (X Version 11, Release 7.6)

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-10-03 12:19:54 -07:00
Gaetan Nadon
ee3e26079e ddxDesign: drop the url in the coporate authors list
It was such an eyesore once rendered in html.
Now it looks like other authors.

Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-10-03 12:18:37 -07:00
Gaetan Nadon
0ed71b48c0 ddxDesign: remove server version from the document title
Such version information is already written in the appropriate location

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-10-03 12:18:35 -07:00
Gaetan Nadon
83ec3bf1aa ddx-Design: add X Version and Release information
Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-10-03 12:18:31 -07:00
Gaetan Nadon
2f09f6e3f6 Xinput: use appropriate copyright markup for a multi licensed doc
Removed a duplicate paragraph.

Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-10-03 12:02:42 -07:00
Gaetan Nadon
597348e969 Xinput: replace hard coded X11 version with X server version
Which is more useful.

Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-10-03 12:02:32 -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
Jamey Sharp
77743f877d kdrive: Fix build for opaque InputOption structure.
Commit 05284a03f9 missed fixing up
kdrive's use of the old non-opaque structure.

Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-10-03 11:51:00 -07:00
Keith Packard
9a55b3661b Merge remote-tracking branch 'alanc/master' 2011-10-03 11:49:23 -07:00
Keith Packard
cf11ca360c Merge remote-tracking branch 'jeremyhu/for-keith' 2011-10-03 11:44:59 -07:00
Pauli Nieminen
463dd87062 xf86/modes: Fix shadow rotation crashing when screen pixmap changes
Driver may change screen pixmaps after page flipping that would then
make damage lose track of the root pixmap.

Using root window for shadow damages fixes the problem because
SetWindowPixmap is implemented in shadow code.

Signed-off-by: Pauli Nieminen <pauli.nieminen@linux.intel.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-10-03 11:41:22 -07:00
Keith Packard
f5d50b46dd Merge remote-tracking branch 'whot/next' 2011-10-03 11:36:28 -07:00
Aaron Plattner
57cd32e934 xfree86/modes: Make cursor position transform a helper function
When the driver can handle the crtc transform in hardware, it sets
crtc->driverIsPerformingTransform, which turns off both the shadow
layer and the cursor's position-transforming code.  However, some
drivers actually do require the cursor position to still be
transformed in these cases.  Move the cursor position transform into a
helper function that can be called by such drivers.

Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
2011-10-03 11:30:04 -07:00
Aaron Plattner
245cb8e94f xfree86/modes: Let the driver handle the transform
If a driver can use hardware to handle the crtc transform, then
there's no need for the server's shadow layer to do it.  Add a crtc
flag that lets the driver indicate that it is handling the transform.
If it's set, consider the transformed size of the screen but don't
actually enable the shadow layer.  Also stop adjusting the cursor
image and position.

Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
2011-10-03 11:30:00 -07:00
Keith Packard
e089737fb1 Add AC_LANG_SOURCE wrappers around configure.ac code fragments
Current autoconf versions are very unhappy when code fragments are not
wrapped in AC_LANG_SOURCE macros, generating errors like:

configure.ac:723: warning: AC_LANG_CONFTEST: no AC_LANG_SOURCE call detected in body
../../lib/autoconf/lang.m4:194: AC_LANG_CONFTEST is expanded from...
../../lib/autoconf/general.m4:2662: _AC_LINK_IFELSE is expanded from...
../../lib/autoconf/general.m4:2679: AC_LINK_IFELSE is expanded from...
../../lib/m4sugar/m4sh.m4:606: AS_IF is expanded from...
../../lib/autoconf/general.m4:2032: AC_CACHE_VAL is expanded from...
../../lib/autoconf/general.m4:2053: AC_CACHE_CHECK is expanded from...
configure.ac:723: the top level

Signed-off-by: Keith Packard <keithp@keithp.com>
2011-10-03 11:23:16 -07:00
Matt Turner
6eae9fa284 Remove incorrect & in swap_uint32
Caused by commit 893e86a4, and hidden by the (char *) cast.

Signed-off-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
Tested-by: Aaron Plattner <aplattner@nvidia.com>
2011-10-03 10:23:54 -07:00
Alan Coopersmith
524e5445c0 Add #include "inpututils.h" to xkbAccessX.c for init_device_event
Fixes Sun compiler warning:
"xkbAccessX.c", line 128: warning: implicit function declaration: init_device_event

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-10-03 08:54:09 +10:00
Matthieu Herrb
98b230669f sdksyms.sh may not be executable.
Use $(SHELL) to run it. Someone may want to build out of a source tree
in a filesystem with the noexec mount flag set.

Signed-off-by: Matthieu Herrb <matthieu.herrb@laas.fr>
Reviewed-by: Gaetan Nadon <memsize@videotron.ca>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-10-01 17:35:19 +02: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
Max Schwarz
f32c827d51 Input: Fix frac calculation on [Raw]DeviceEvent conversion
(1UL << 32) evaluates to 0 (at least here), so do the
fraction calculation in two steps as in libXi. Fractions on xXIRawEvent
were not multiplied at all, which also gave 0 as result.

Signed-off-by: Max Schwarz <Max@x-quadraht.de>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-09-30 09:25:03 +10:00
Peter Hutterer
4c6bc0e765 Merge branch 'smooth-scrolling' into next 2011-09-30 09:24:56 +10:00
Peter Hutterer
3304bbff9b Input: Add smooth-scrolling support to GetPointerEvents
For scroll wheel support, we used to send buttons 4/5 and 6/7 for
horizontal/vertical positive/negative scroll events.  For touchpads, we
really want more fine-grained scroll values.  GetPointerEvents now
accepts both old-school scroll button presses, and new-style scroll axis
events, while emitting both types of events to support both old and new
clients.

This works with the new XIScrollClass to mark axes as scrolling axes.
Drivers mark any valuators that send scroll events with SetScrollValuator.
(Currently missing: the XIDeviceChangeEvent being sent when a driver changes
a scroll axis at run-time. This can be added later.)

Note: the SCROLL_TYPE enums are intentionally different values to the XI2
proto values to avoid copy/overlapping range bugs.

Co-authored-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-09-30 09:24:18 +10:00
Alexandr Shadchin
ac5881d6d0 Remove unused vtSysreq
Signed-off-by: Alexandr Shadchin <Alexandr.Shadchin@gmail.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
Tested-by: Matthieu Herrb <matthieu.herrb@laas.fr>
2011-09-29 23:05:35 +06:00
Alexandr Shadchin
0be1640dbb bsd: ioctl KDENABIO/KDDISABIO do not matter for OpenBSD
Signed-off-by: Alexandr Shadchin <Alexandr.Shadchin@gmail.com>
Tested-by: Matthieu Herrb <matthieu.herrb@laas.fr>
2011-09-29 23:05:35 +06:00
Alexandr Shadchin
91042b98af bsd: OpenBSD and NetBSD not need extra headers in PCVT_SUPPORT
Signed-off-by: Alexandr Shadchin <Alexandr.Shadchin@gmail.com>
Tested-by: Matthieu Herrb <matthieu.herrb@laas.fr>
2011-09-29 23:05:35 +06:00
Alexandr Shadchin
86eaa9bbe4 bsd: Some clean up
OpenBSD and NetBSD does not support syscons

Signed-off-by: Alexandr Shadchin <Alexandr.Shadchin@gmail.com>
Tested-by: Matthieu Herrb <matthieu.herrb@laas.fr>
2011-09-29 23:05:35 +06:00