Commit Graph

731 Commits

Author SHA1 Message Date
Eamon Walsh
2d7ba09dc4 Make devPrivates lookup functions ABI instead of static inlines.
This is required to preserve compatibility across changes to the
internal representation of the privates list.
2008-06-13 16:43:56 -04:00
Peter Hutterer
6ab311c92d dix: Call RealizeCursor during InitializeSprite.
RealizeCursor should be called when the cursor is allocated. However, when the
root cursor is allocated, no devices exist yet, and thus RealizeCursor is
never called. This may lead to segfaults lateron in DDXes like Xnest that
actually need to do something for each cursor, and lateron rely on that
DDX-specific data for each cursor has been initialized.
2008-06-11 17:24:19 +09:30
Peter Hutterer
fbf4b5f16a dix: set dst->mapWidth when allocating a new map. 2008-06-05 08:53:34 +09:30
Peter Hutterer
45b661c67a dix: Fix build with --disable-xinerama #16204
X.Org Bug 16204 <http://bugs.freedesktop.org/show_bug.cgi?id=16204>
2008-06-04 13:39:39 +09:30
Peter Hutterer
5a3d06b8f4 xkb: delete default rules when devices are closed.
We only have one set of default rules options in xkb. When the second keyboard
is brought up with Xkb options specified, these new options overwrite the old.
In future server generations, the rules used for the VCK are a mixture of the
default ones and ones previously specified for other keyboards. Simply
resetting the xkb default rules to NULL avoids this issue.

Reproducable by setting XkbLayout "de" and XkbVariant "nodeadkeys". In the
second server generation, the VCK has "us(nodeadkeys)". This again produces a
SIGABRT when the first key is hit.

I could not figure out why the SIGABRT happens. This patch is avoiding the
issue rather than fixing it.
2008-06-02 10:27:05 +09:30
Peter Hutterer
a7ae9cbd78 dix: don't read valuators past numAxes. 2008-06-02 10:25:52 +09:30
Peter Hutterer
942086fc96 dix: ProcQueryPointer doesn't need special grab handling, PickPointer does it 2008-05-31 18:17:49 +09:30
Peter Hutterer
6cecae0e86 dix: Remove superfluous comment.
This code can handle devices with < 2 valuators now.
2008-05-31 17:42:06 +09:30
Peter Hutterer
62c1a32976 dix: null out dummyDev, otherwise Xephyr dereferences random pointers.
SendEventToAllWindow eventually causes a IsInterferingGrab(), which attempts
to dereference dev->deviceGrab.grab.
2008-05-31 17:42:05 +09:30
Peter Hutterer
26c1958c32 Merge branch 'master' into mpx 2008-05-26 17:37:31 +09:30
Peter Hutterer
5fe57787fa dix: store the absolute values in the motion history.
The core protocol requires absolute values and it's a bit hard to get them if
we only have relative ones in the history. Switch the motion history to
absolute, and if we really need the relative values, we can probably generated
them from the abs. ones in the future.
2008-05-26 17:27:32 +09:30
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
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
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
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
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
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
George Sapountzis
255142b61e drop xprint remnants: InitGlobals 2008-05-21 18:13:09 +03:00
George Sapountzis
641ce9c706 drop xprint remnants: xpstubs 2008-05-21 18:13:04 +03:00
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
7a550cefd9 dix: shut up two compiler warnings. 2008-05-20 11:07:39 +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
07f69023b0 Move defaultDisplayClass to xdmcp-only visibility. 2008-05-14 16:07:51 -04:00
Adam Jackson
166177e36b Simplify default font path setup. 2008-05-14 16:02:05 -04:00
Adam Jackson
2efe1abb6f Remove global argc/argv variables.
Was only used in the logging code anymore, and uselessly so there.
2008-05-14 15:53:11 -04:00
Peter Hutterer
937e5aae33 dix: don't undisplay cursor if we don't own a sprite.
Sometimes we didn't have a cursor when coming back from suspend. Reason was
that the suspend caused the server to lose the device that was attached to the
VCP, and a RemoveDevice() would then set the cursor to NULL.
Solution: only set the cursor to NULL if we actually own the sprite.
2008-05-14 22:30:15 +09:30
Peter Hutterer
00db0f35ac dix: InitAndStartDevices doesn't need a window parameter.
Leftover from the old pointer-keyboard pairing code, obsolete and gone now.
2008-05-14 15:29:28 +09:30
Peter Hutterer
da728f2127 dix: don't use serverClient in AddInputDevice, use the one supplied instead.
We pass in the client that wants to create the device anyway, lets use the
parameter instead of hardcoding the serverClient.

Wow. I hope this is merge detritus, otherwise it'd be a sign that I didn't
have enough coffee that day.
2008-05-14 15:17:05 +09:30
Peter Hutterer
1fc1a2897e Remove UndisplayCursor API.
We can achieve the same thing by simply displaying a NullCursor, there's no
need for a separate API.
2008-05-13 11:17:02 +09:30
Adam Jackson
1c8bd318fb X n'est pas une print API. 2008-05-12 14:15:11 -04:00
Alan Coopersmith
1a01e96c6d Return a valid X error when stuck in font alias loop
Part of fix for Sun bug 4258475
<http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=4258475>
2008-05-09 15:38:44 -07:00
Peter Hutterer
3344569529 Merge branch 'master' into mpx
Conflicts:

	Xi/exevents.c
	dix/devices.c
2008-05-02 11:00:14 +09:30
Peter Hutterer
8e56fd9728 dix: continue to check for invalid valuator ranges.
In an ideal world, the drivers would init all axes with NO_AXIS_LIMIT. In the
real world, this is an ABI break, so let's just leave the old check in.
2008-05-02 10:22:06 +09:30
Jeremy Huddleston
28d1e21f15 Dix: Cleaned up sanity checking in Get{Pointer,Keyboard}Events
XQuartz was crashing because the Appkit thread was trying to GetXXXEvents while the Xserver thread was exiting.
This adds some more sanity checks and avoids that crash
(cherry picked from commit 34ec4bd6ac)
2008-04-30 17:33:07 -07:00
Peter Hutterer
a0e6a7d4f5 dix: resize EQ to minimum size to avoid reallocs during SIGIO.
When a new device is added, calculate the event size needed if a DCCE event is
sent and set the EQ's event size to this minimum. This avoids reallocs when a
event is sent (which may happen during a SIGIO).
2008-04-30 17:57:48 +09:30
Peter Hutterer
fea39c94bc dix: fix typo from last commit. 2008-04-30 13:17:14 +09:30
Peter Hutterer
ffaccc2dc9 input: replace -1 as default axis limit with NO_AXIS_LIMIT define.
This allows easier refacturing of the coordinate limit handling. Grepping for
-1 is boring.
2008-04-30 11:49:11 +09:30
Peter Hutterer
00acb40f2b dix: fix typo in clipAxis.
Check needs to be (min_axis < max_axis), not (min_axis < min_axis)
2008-04-30 11:29:03 +09:30
Peter Hutterer
f2a20294fe dix: store all valuators as they come from the device in the valuator events.
The event's sequenceNumber is mis-used to determine whether the values are
relative or absolute.
2008-04-29 11:18:35 +09:30
Peter Hutterer
53dba5381f dix: if alloc of a master keyboard fails, remove the master pointer. 2008-04-28 11:37:52 +09:30
Jeremy Huddleston
ef1c520537 XQuartz: Cleaned up startup and thread creation a tad.
(cherry picked from commit c861fe00e1)
2008-04-26 19:21:05 -07:00
Peter Hutterer
1d0438de17 Xi: remove RemoveOtherCoreGrabs()
PickPointer() returns grabbed devices, so we can't get a double grab anyway.
2008-04-25 16:28:58 +09:30