Commit Graph

5743 Commits

Author SHA1 Message Date
Peter Hutterer
1883485edd If core motion history is required, scale back to screen coords and INT16. 2008-05-26 17:22:25 +09:30
Peter Hutterer
0b88510069 Ensure the motion history is merged for master devices.
Add each event to the master's MH as well as to the SDs. In the MD, store
min/max and the actual value. When retrieving the MH, rescale all coordinates
to the current coordinate range and only post those valuators that are
currently active on the device.
2008-05-26 15:55:20 +09:30
Peter Hutterer
d22c25bda4 dix: Allocate MD's motion history to be large enough for potential valuators
Since we can't predict how many valuators may be in a future SD attached to an
MD, we need to preallocate a history buffer that is large enough to keep
MAX_VALUATORS coordinates per event.

In addition, the history buffer needs to memorize the coordinate ranges at the
time, thus requiring MDs to store (min_val, max_val, current_val, time)
instead of (current_val, time) for each motion history entry.

This commit only fixes the allocation.
2008-05-26 09:26:18 +09:30
Peter Hutterer
0877de13ac Remove GetMotionProc from ValuatorClassRec.
With the MD/SD device hierarchy we need control over the generation of the
motion history as well as the conversion later before posting it to the
client. So let's not let the drivers change it.

No x.org driver currently uses it anyway, linuxwacom doesn't either so dumping
it seems safe enough.
2008-05-25 22:49:54 +09:30
Peter Hutterer
00b4339168 dmx: remove some #if 0'd code. 2008-05-25 22:34:11 +09:30
Peter Hutterer
096117cf02 Xi: reset motion history when swapping device classes.
This isn't really the correct solution, but it'll have to do until I figured
out how to transfer the history over correctly.
2008-05-25 10:38:33 +09:30
Peter Hutterer
ba557e0263 Xi: remove deprecated comment.
Axis clipping wouldn't be necessary here, it's already performed in GPE.
2008-05-24 17:23:10 +09:30
Peter Hutterer
3ae0f4fc83 dix: update valuators > 2 as well.
master->last.valuator[x] for x > 2 is undefined. For all other devices, it's
the respective device's last valuators.

If the lastSlave did not have a valuator that is to be updated now, it is
reset to 0.
2008-05-23 15:52:40 +09:30
Peter Hutterer
0d1b41ace3 Xi: update device valuators based on the event.
Event is always absolute, update the device's valuators (always absolute too),
and then change the deviceValuator event to reflect the device's reporting
mode.
2008-05-23 13:32:33 +09:30
Peter Hutterer
7eec1c23a3 dix: don't allow relative data in deviceValuators.
In GPE, we don't care about the device mode. Let's put the absolute values
into the deviceValuator event and worry about relative valuators on the other
side of the EQ.
2008-05-23 13:23:02 +09:30
Peter Hutterer
75551a2ef9 Revert "dix: Correct values in the device axisVal are calculated in GPE"
We can't rely on GPE to update device->valuators->axisVal. If a SIGIO occurs
during event processing this may have incoherent results.

This reverts commit f6645ddbf7.
2008-05-23 12:55:50 +09:30
Peter Hutterer
fe59b1a62b dix: more device scaling insanity.
Assuming master->last.valuators is in screen coords, SD's are always in device
coordinates.

1. If an event comes in, scale masters->last to the device, drop into device's
last->valuators.
2. Apply motion from the actual event
3. Scale back to screen coords, check if we may need to cross screens
4. Drop screen coords into master->last
5. Rescale to device coords, drop into deviceValuator event and SD->last
6. Drop screen coords into ev->root_x/y

Whoopee...
2008-05-23 12:51:52 +09:30
Peter Hutterer
6c9e9f8a40 input: instead of lastx/y, use a last.valuators[] array on the device.
During GetPointerEvents (and others), we need to access the last coordinates
posted for this device from the driver (not as posted to the client!). Lastx/y
is ok if we only have two axes, but with more complex devices we also need to
transition between all other axes.

ABI break, recompile your input drivers.
2008-05-23 12:01:37 +09:30
Peter Hutterer
fb146cbb0f dix: coreEvents doesn't have meaning here, use master instead.
We mustn't clip x/y if we are attached, otherwise we can't change screens.
2008-05-23 12:01:09 +09:30
Magnus Vigerlöf
fc1cc0adcb dix: Cleanup of GetPointerEvents
Changed all the checks for x&y valuator so the more complex
calculation is only made once.
Added TODOs for valuator/axis 2 and above for future correct
handling of relative reporting of these.

Signed-off-by: Peter Hutterer <peter@cs.unisa.edu.au>
2008-05-23 09:33:09 +09:30
Magnus Vigerlöf
a0241d5380 dix: Correct clipAxis so it can handle devices with value ranges properly
Signed-off-by: Peter Hutterer <peter@cs.unisa.edu.au>
2008-05-23 09:30:43 +09:30
Magnus Vigerlöf
f6645ddbf7 dix: Correct values in the device axisVal are calculated in GPE
Signed-off-by: Peter Hutterer <peter@cs.unisa.edu.au>
2008-05-23 09:20:01 +09:30
Peter Hutterer
7f85acdf70 dix: fill valuators with the correct values depending on the device mode (GPE)
valuators[] is passed from the DDX. Depending on the device mode, update it
with either absolute values or relative values. The deviceValuator event sent
to the client will then contain the respective values.
2008-05-22 23:27:15 +09:30
Peter Hutterer
1a3f351c50 dix: when floating a device, create a new cursor sprite.
This is essentially necessary to allow calls to miPointerGetSprite etc. to
work for floating slave devices.
2008-05-22 23:25:20 +09:30
Peter Hutterer
e0fbe404a4 mi: handle sprite even for floating slave devices.
We still don't render it, but we accept all the other calls to update it's
internal state.
2008-05-22 23:24:29 +09:30
Magnus Vigerlöf
0f15875a27 Make all conversion handling in GPE.
This isn't quite finished yet, but at least it gives us the ability to use a
tablet as a normal mouse - with all the scaling in place.

Signed-off-by: Peter Hutterer <peter@cs.unisa.edu.au>
2008-05-22 19:22:46 +09:30
Peter Hutterer
74372fd004 xfree86: suspend signals while removing a device.
Getting a keyboard event while halfway through freeing memory can be
unpleasant.
2008-05-22 18:08:32 +09:30
Peter Hutterer
30e9a33f7d xkb: fix crash caused by uninitialised variable. 2008-05-22 16:00:21 +09:30
Peter Hutterer
5c5a1eaf68 Replace UniSA with full Uni name in Author affiliation.
Big boss says UniSA isn't unique enough. Who am I to argue?
2008-05-21 21:51:27 +09:30
Peter Hutterer
7509fb498c Merge branch 'hwcursor' into mpx 2008-05-21 16:25:35 +09:30
Peter Hutterer
2ae3bed337 mi: shut up compiler warning (return w/o a value) 2008-05-21 15:51:35 +09:30
Peter Hutterer
4056595fc7 xkb: remove superfluous checks in if statement. 2008-05-20 18:57:54 +09:30
Peter Hutterer
7a550cefd9 dix: shut up two compiler warnings. 2008-05-20 11:07:39 +09:30
Peter Hutterer
f9edecd1b5 mi: sync declaration and definition of mieqResizeEvents. 2008-05-20 11:07:17 +09:30
Peter Hutterer
e73a03d589 fb: shut up two compiler warnings. 2008-05-20 10:54:32 +09:30
Peter Hutterer
99d28c3ef3 Merge branch 'master' into mpx
Conflicts:

	Xext/xprint.c (removed in master)
	config/hal.c
	dix/main.c
	hw/kdrive/ati/ati_cursor.c (removed in master)
	hw/kdrive/i810/i810_cursor.c (removed in master)
	hw/xprint/ddxInit.c (removed in master)
	xkb/ddxLoad.c
2008-05-20 10:20:14 +09:30
Adam Jackson
0178b6a4ab Fix reduced-blanking mode filtering in RANDR 1.2.
If the monitor isn't reduced-blanking (either through EDID logic, or
config file setting), then remove RB modes from the default pool.  Any
RB modes from the driver and config file pools will stick around though;
you asked for them, you got them.
2008-05-19 11:22:19 -04:00
Jeremy Huddleston
bb687465d0 XQuartz: First stab at SCM_RIGHTS passing the $DISPLAY launchd fd from the stub to server
(cherry picked from commit cccee9cfc2)
2008-05-19 02:47:18 -07:00
Jeremy Huddleston
4b69d22bcb XQuartz: Fixed dropped code in the !XKB blocks, disable XKB support until we figure out a solution for xkeyboard-config
(cherry picked from commit 2a72309c06)
2008-05-19 02:47:17 -07:00
Jeremy Huddleston
e997df8cd3 XQuartz: Cleaned up ListenOnOpenFD...
(cherry picked from commit 6fb587d3d5)
2008-05-18 23:32:57 -07:00
Jeremy Huddleston
738672858d New XQuartz icon thanks to Simone Karin Lehmann
(cherry picked from commit c27e0c8f3c)
2008-05-18 23:32:56 -07:00
Jeremy Huddleston
4be2104c80 XQuartz: More work towards Mach-IPC startup... started working on FD passing
(cherry picked from commit 27fbfeacfa)
2008-05-18 22:45:19 -07:00
Julien Cristau
82c4075d4b xfree86: fix initial output positions with Above or LeftOf and rotation
The fix in fa19e84714 was incomplete,
as it was still using the wrong output's initial rotation to compute
the position.
2008-05-19 03:27:12 +02:00
Dave Airlie
7dca84f3ee cursor: don't dereference NULL pointer is devPrivates not yet set.
This fixes a bug on server recycle with ati zaphod.
2008-05-19 11:16:08 +10:00
Jeremy Huddleston
5af5db5033 XQuartz: Ok, pass XQUARTZ_USE_XKB since it breaks worse without it... but we have issues when we have the keyboard configs installed... need to figure out what to do there...
(cherry picked from commit 301262b070)
2008-05-17 14:56:57 -07:00
Jeremy Huddleston
2408303d79 XQuartz: Added functionality to add a file descriptor to the connection list after the server is already running.
(cherry picked from commit 543c2cd68d)
2008-05-17 14:56:53 -07:00
Jeremy Huddleston
01612fe612 XQuartz: Disable xkb since it doesn't work after getting xkeyboard-config installed
Need to setup configs for the quartz keyboard
(cherry picked from commit c28fecc621)
2008-05-17 14:56:34 -07:00
Jeremy Huddleston
1d09deaa6e XQuartz: Made DarwinSendDDXEvent a little more robust to context switching diring server init.
(cherry picked from commit 5626b0949b)
2008-05-17 14:56:30 -07:00
Jeremy Huddleston
adc62f62b9 Xquartz: Xquartz stub now can send Mach IPC to start the server.
(cherry picked from commit 55a3bca8ea)
2008-05-17 14:56:26 -07:00
Brad Smith
93c082a060 OpenBSD doesn't define __x86_64__, simplify tests.
Seeing as this code seems to be specific to OpenBSD I don't think
__x86_64__ should have been added there at all. It appears to have
been added wherever __amd64__ existed before which is wrong. I
think that part of the commit should be reverted but also all four of
the checks should be __OpenBSD__ && __amd64__ instead of two one
direction and two flipped.
2008-05-17 13:14:31 +02:00
Brad Smith
895d4e274d BSD's also have /dev/urandom. 2008-05-17 13:05:58 +02:00
Adam Jackson
aad1c37b09 RANDR 1.1 compat: remove senseless comparison against the virtual size. 2008-05-16 11:10:33 -04:00
Adam Jackson
14726b776d xf86SetDesiredModes(): Skip disabled CRTCs first thing. 2008-05-16 11:10:33 -04:00
Adam Jackson
459f34b089 Fix initial mode selection even harder.
The first guess used to be "is the preferred mode for one output the
preferred mode on all outputs".  Instead, do "find the largest mode that's
preferred for at least one output and available on all outputs".
2008-05-16 11:10:33 -04:00
Adam Jackson
96111c1547 Redo RANDR compatibility output selection.
Old logic was just the first one that happened to have an associated
CRTC.  The new logic tries to find one that's definitely connected, has
probed modes, and has the largest candidate mode.
2008-05-16 11:10:32 -04:00