Commit Graph

11551 Commits

Author SHA1 Message Date
Peter Hutterer
6aef209ebc Change lastDeviceIdleTime to be per-device
Preparation work for per-device idle counters.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: James Jones <jajones@nvidia.com>
2012-03-22 13:12:56 +10:00
Peter Hutterer
20cf0ef825 Xext: strdup() the SystemSyncCounter name
Required for future dynamic names.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: James Jones <jajones@nvidia.com>
2012-03-22 13:12:56 +10:00
Peter Hutterer
f1b28aea41 Xext: store the bracket values for idle counters in the private
And drop the three global variables, we have a reference to the counter
everywhere now.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: James Jones <jajones@nvidia.com>
2012-03-22 13:12:55 +10:00
Peter Hutterer
d9553b2bbe Xext: pass the counter into block/wakeup handlers
No functional changes, currently unused. Preparation work, we don't need a
global variable if we can pass the counters around anyway.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: James Jones <jajones@nvidia.com>
2012-03-22 13:12:55 +10:00
Peter Hutterer
90e6dc6de1 Xext: add a private field to SyncSystemCounters
Will be used to store counter-specific data.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: James Jones <jajones@nvidia.com>
2012-03-22 13:12:55 +10:00
Peter Hutterer
3ddae647c3 Xext: localise pIdleTimeValueLess/Greater
Cleanup for future features, no functional changes.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: James Jones <jajones@nvidia.com>
2012-03-22 13:12:55 +10:00
Peter Hutterer
43eb2f2758 Xext: localise use of IdleTimeCounter
Instead of referring to the global IdleTimeCounter everywhere, only do it
once and use a local variable for the rest.

Cleanup for future features, no functional changes.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: James Jones <jajones@nvidia.com>
2012-03-22 13:12:55 +10:00
Jamey Sharp
1f12f059ef sync: Use a linked list instead of an array for SysCounterList.
Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-03-22 13:12:55 +10:00
Peter Hutterer
61cb98da1c Xext: SyncCreateSystemCounter returns a SyncCounter*
type safety++

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Bryce Harrington <bryce@canonical.com>
2012-03-22 11:33:21 +10:00
Peter Hutterer
45fe3085f8 Xext: remove needless /* parameter */ comments in declaration
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Bryce Harrington <bryce@canonical.com>
2012-03-22 11:33:21 +10:00
Peter Hutterer
e21ffff476 Xext: typedef QueryValue and BracketValue prototypes
No functional changes, just for readability

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Bryce Harrington <bryce@canonical.com>
2012-03-22 11:33:21 +10:00
Peter Hutterer
5910f2df58 Xext: drop InitServertime() declaration.
Not implemented anywhere.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Bryce Harrington <bryce@canonical.com>
2012-03-22 11:33:21 +10:00
Chase Douglas
31df08a449 Use a new sprite trace for indirect touches when all touches have physically ended
All touches of an indirect device, such as a trackpad, are sent to the
same window set. When there are no active touches, a new window set is
created; otherwise, the window set of an existing touch is copied.

The current code checks for any logically active touches. This includes
touches that have physically ended but are still logically active due to
unhandled touch grabs. Instead, we want a new window set whenever there
are no physically active touches.

This change skips over logically active but pending end touches, which
are touches that have physically ended.

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>
2012-03-22 11:33:20 +10:00
Chase Douglas
58427e08a4 Xi: Fix TouchEnd to TouchUpdate change for one accepted grab
If there is only one listener of a touch, the listener is a grab, and is
accepted before the touch has ended, the current code will not end the
touch record when the touch does end.

This change adds a listener state for when a touch is accepted but has
not yet ended. We now keep the touch record alive in this state, but end
it when the touch ends.

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>
2012-03-22 11:33:20 +10:00
Peter Hutterer
e884ff8ad4 xfree86: remove out-of-date comment
No idea what this was referring to but it goes past git history.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-03-22 11:33:20 +10:00
Peter Hutterer
5497ce3da4 dix: IsFloating() on master devices is always false
There are a few subtle bugs during startup where IsFloating() returns true
if the device is a master device that is not yet paired with its keyboard
device.

Force IsFloating() to always return FALSE for master devices, that was the
intent after all and any code that relies on the other behaviour should be
fixed instead.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Tested-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2012-03-22 11:33:20 +10:00
Peter Hutterer
2c23ef83b0 Xi: prohibit multiple XIQueryVersion requests with different versions
Return BadValue if major or minor differs on the second call.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2012-03-22 11:33:20 +10:00
Peter Hutterer
eb84c154ed dix: when rescaling from master, rescale from desktop dimensions (#46657)
master->last.valuators[] is in desktop dimensions, so use those as
rescale axis ranges, not the screen. Otherwise, a rescale on any screen
not the top-left will cause out-of-bounds coordinates which will always
map to the bottom-right screen, causing the device to be stuck on that
screen.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2012-03-22 11:33:20 +10:00
Peter Hutterer
6b6afd3d01 Xext: return BadAccess if PickPointer fails (#45796)
PickPointer or PickKeyboard return NULL, all MDs are currently disabled and
we cannot emulate a core event. This wasn't anticipated by the protocol, so
we don't really have an error code we may use here - BadAccess is simply the
least bad of the possible ones.

And returning BadAccess beats crashing the server.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-03-22 11:33:20 +10:00
Andreas Wettstein
9e017cf0cf XKB: Redirect actions defunct with Gtk3 (XInput?)
When redirect actions are used with Gtk3, Gtk3 complained about
events not holding a GdkDevice.  This was caused by device IDs
not being set for redirect actions.

More seriously, Gtk3 did not receive state changes redirect
actions might specify.  This was because event_set_state in
dix/inpututils.c accesses the prev_state field, but the changes
for the redirect action were only put into the state field.

Signed-off-by: Andreas Wettstein <wettstein509@solnet.ch>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-03-22 11:33:18 +10:00
Daniel Stone
ab3a815a75 Indentation: Change '& stuff' to '&stuff'
If the typedef wasn't perfect, indent would get confused and change:
    foo = (SomePointlessTypedef *) &stuff[1];
to:
    foo = (SomePointlessTypedef *) & stuff[1];

Fix this up with a really naïve sed script, plus some hand-editing to
change some false positives in XKB back.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-03-21 14:02:30 -07:00
Daniel Stone
58b1f739d7 Xinerama: Fix up obnoxiously-indented code
Comments inside of conditionals confuse indent to death.  Which is fair
enough really.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-03-21 14:02:24 -07: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
Keith Packard
75199129c6 Handle blank betweeen type and name in sdksyms.sh
indent sometimes adds a blank line between the type and the name in a
function declaration that includes _X_EXPORT, so handle that before
the files are re-indented.

Signed-off-by: Keith Packard <keithp@keithp.com>
2012-03-21 12:33:19 -07:00
Keith Packard
a615b90cab Bump version number to 1.12.99.0
Now that 1.12 has branched, reset the version on master to a
development number.

Signed-off-by: Keith Packard <keithp@keithp.com>
2012-03-14 11:32:36 -07:00
Keith Packard
b1be72c5ca Version bumped to 1.12
Signed-off-by: Keith Packard <keithp@keithp.com>
2012-03-04 20:26:18 -08:00
Gaetan Nadon
e08ed0b757 test: add new test cases to .gitignore
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>
2012-03-04 20:01:29 -08:00
Peter Hutterer
2416ee4a01 dix: avoid NULL-pointer dereference on button-only devices (#38313)
And for such devices simply take the last.valuators[] which must be valid at
all times anyway. UpdateSlaveDeviceCoords takes care of that.

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: Chase Douglas <chase.douglas@canonical.com>
2012-02-27 13:01:45 +10:00
Jeremy Huddleston
38000e7d1f Revert "dix: don't XWarpPointer through the last slave anymore (#38313)"
This reverts commit 2bfb802839.

This commit caused a regression.

See: http://xquartz.macosforge.org/trac/ticket/517#comment:10

Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-02-22 21:15:41 -08:00
Jeremy Huddleston
cb6a32da27 XQuartz: Short-circuit activateX:
This also avoids a deadlock when calling activateX: before the server
thread has initialized

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2012-02-22 21:15:10 -08:00
Jeremy Huddleston
1562c4a1ca XQuartz: Actually install the new locales
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2012-02-22 21:15:09 -08:00
Keith Packard
71594746c7 Merge remote-tracking branch 'whot/for-keith' 2012-02-22 18:07:20 +13:00
Chase Douglas
eaba06a27c Keep virtual core pointer touch class around if new slave doesn't have one
The VCP may have active touch grabs. The touch records must be kept so
these touch grabs may be accepted/rejected in the future. This means the
touch class list will not represent the touch class of the attached
slave device if it does not have a touch class, but we already were
breaking that assumption by keeping a separate touches array for the
VCP.

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>
2012-02-15 11:09:32 +10:00
Peter Hutterer
8573b3519a Don't clobber virtual core pointer touches array length
The VCP has its own touches array, don't overwrite it when the class is
copied from the SD to the master.

Reported-by: Chase Douglas <chase.douglas@canonical.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2012-02-15 11:09:20 +10:00
Chase Douglas
03d32fe7a7 Don't dereference a touch after it has been ended when punting to next owner
In this case, we have ended the touch because the last owner has
rejected it. We need to return from the function right now so we don't
attempt to dereference another touch client for early acceptance
processing.

Signed-off-by: Chase Douglas <chase.douglas@ubuntu.com>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-02-15 10:14:55 +10:00
Chase Douglas
1ecb7aaf2a Focus event button state must show the logical buttons, not physical buttons
Similar to the fix in fcda98c486. This
ensures we show the correct logical state of the buttons in device focus
events too.

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>
2012-02-15 10:14:55 +10:00
Peter Hutterer
6f28388187 dix: reset last.scroll when resetting the valuator (#45611)
last.scroll remained on the last-submitted scrolling value but last.valuator
was changed whenever the slave device changed. The first scrolling delta
after a switch was then calculated as (last.scroll - new abs value), causing
erroneous scrolling events.

Test case:
- synaptics with a scrolling method enabled, other device with 3+ axes (e.g.
  wacom)
- scroll on touchpad
- use other device
- scroll on touchpad

The second scroll caused erroneous button press/release events.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2012-02-14 21:47:30 +10:00
Jeremy Huddleston
d53235af85 XQuartz: Build fix for possible conflict of BOOL type
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2012-02-13 23:06:07 -08:00
Keith Packard
62edd970f6 Bump to version 1.11.99.903 (1.12 RC3)
Signed-off-by: Keith Packard <keithp@keithp.com>
2012-02-11 16:13:44 +13:00
Keith Packard
42b6756463 Merge remote-tracking branch 'alanc/master' 2012-02-11 15:36:43 +13:00
Peter Hutterer
7674d00b04 Xi: handle new XIAllowEvents request in inputproto 2.1.99.6
grab_window and touchid were removed from the struct for ABI compatibility
reasons, we need to pull in the new, XI 2.2-specific struct.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2012-02-11 15:26:05 +13:00
Peter Hutterer
ceb026c6a6 Xi: handle new XIAllowEvents request in inputproto 2.1.99.6
grab_window and touchid were removed from the struct for ABI compatibility
reasons, we need to pull in the new, XI 2.2-specific struct.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-02-09 08:02:44 +10:00
Benjamin Otte
b96275c4cd dix: fix an out-of-memory crash
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-02-08 19:06:17 +10:00
Chase Douglas
6241b5e4fd Implement touch early accept
This doesn't really implement early accept as it should. Ideally, the
server should send end events to all subsequent touch clients as soon as
an early accept comes in. However, this implementation is still protocol
compliant. We can always improve it later.

Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-02-08 18:04:15 +10:00
Chase Douglas
b0c54856df Implement early touch reject
Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-02-08 18:04:15 +10:00
Chase Douglas
656ab879f2 Check for proper window ID when processing touch allow requests
Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-02-08 18:04:15 +10:00
Chase Douglas
9a260e9af8 Move AllowTouch to dix/touch.c, and rename to TouchAcceptReject
Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-02-08 18:04:15 +10:00
Chase Douglas
192b2c9a2e Export TouchEventRejected as TouchRejected
This function is mostly correct for early reject usage. With a small
change to pass the client resource explicitly and making the
TouchOwnership event optional, it is usable for all rejection scenarios.
This change exports it for use outside Xi/exevents.c and modifies the
name accordingly.

Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-02-08 18:04:15 +10:00
Chase Douglas
19073425e5 Factor out TouchEnd generation and delivery
The server often needs to generate and deliver TouchEnd events for
circumstances including touch grab acceptance and rejection. This change
refactors the code so it can be used more easily.

Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-02-08 18:04:14 +10:00
Chase Douglas
ab60cadc2a Store window pointer in touch listener record
Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-02-08 18:04:14 +10:00