Commit Graph

828 Commits

Author SHA1 Message Date
Peter Hutterer
98f01c2abe dix: fix endianess issue in AddInputDevice. #18111
dev->enabled is a Bool. Bool is two bytes.
BOOL on the other hand is a protocol type and always 1 byte. So copy the value
into the one-byte type before passing it into XIChangeDeviceProperty.

Found by Michel Dänzer.

X.Org Bug 18111 <http://bugs.freedesktop.org/show_bug.cgi?id=18111>
2008-10-23 17:39:07 +10:30
Peter Hutterer
f6cbe0326c dix: init remaining three xkb fields to zero in a new client. 2008-10-22 18:16:12 +10:30
Peter Hutterer
f3f6ea89aa Xi: check all handlers before applying property changes.
The current code exposes to inconsistent updates, i.e. if handler N succeeds
but handler N+1 fails in setting the property, an error is returned to the
client although parts of the server now behave as if the property change
succeeded.

This patch adds a "checkonly" parameter to the SetProperty handler. The
handlers are then called twice, once with checkonly set to TRUE.
On the checkonly run, handlers _MUST_ return error codes if the property
cannot be applied. Handlers are not permitted to actually apply the changes.
On the second run, handlers are permitted to apply property changes.
Errors codes returned on the second run are ignored.
2008-10-13 13:50:40 +10:30
Peter Hutterer
ad67e3f063 dix: remove duplicate code in ReleaseActiveGrabs
Spotted by Colin Harrison.
2008-10-13 13:50:40 +10:30
Peter Hutterer
decec14219 dix: silence "unused variable" compiler warning. 2008-10-10 16:57:32 +10:30
Tiago Vignatti
d1bb5e3b47 mi: functions here are carrying 'time' without need. 2008-10-08 03:41:17 -03:00
Adam Jackson
30193fbff9 Reinstate cursorScreenDevPriv 2008-10-07 10:36:12 -04:00
Adam Jackson
c6d6d3e87a Loader: Unexport a handful of consumerless symbols from dixsym. 2008-10-06 16:18:21 -04:00
Adam Jackson
8a5b89e8e1 xalloc+memset(0) -> xcalloc 2008-10-06 15:36:51 -04:00
Adam Jackson
0b7b89fbac xalloc+bzero -> xcalloc 2008-10-06 14:19:30 -04:00
Adam Jackson
94825ad3c7 Remove unused wrapping for visual initialization. 2008-10-03 17:51:21 -04:00
Adam Jackson
0ce61e21d6 Remove the Must_have_memory hack.
Also remove an astonishing amount of misunderstanding of how casts work.
2008-10-03 17:51:19 -04:00
Adam Jackson
e6b1c1fada const cleanup 2008-10-03 17:51:19 -04:00
Adam Jackson
1c1a6e965d Remove an utterly, utterly ancient changelog.
Wow.
2008-10-03 11:58:20 -04:00
Peter Hutterer
9c8a2be2c7 dix: fix axis scaling.
For two axes [a, b] and [x, y] (inclusive), the formula to scale point P(ab)
to (x,y) is:
    (P - a)/(b - a) * (y - x) + x

And the whole end result rounded of course to get the integer we need.
2008-10-03 15:27:07 +09:30
Peter Hutterer
93ef72fa26 dix: don't lose subpixel precision when scaling.
Only scale x/y back from screen range if we have crossed screen, otherwise
leave it as it is.
2008-10-03 15:27:07 +09:30
Simon Thum
5ef5e89f0e dix: fix non-initialization of pointer accel in master devices.
Init MDs always with PtrAccelNoOp.

Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
2008-10-03 15:27:07 +09:30
Adam Jackson
00f01f3945 Don't inherit XAUTHORITY from the environment.
It's not especially obvious, and unpleasantly overloaded for the Xnest
case.  Typically this gives you a server that looks for its auth data in
the authority file you were using for the running X session, which
generally doesn't have an entry for the display you just started.

All the major dm's, and startx, pass -auth explicitly, so this shouldn't
cause too much upheaval.
2008-10-02 15:48:18 -04:00
Peter Hutterer
fbd09486c6 Push server-known properties into xserver-properties.h. 2008-09-26 13:32:11 +09:30
Peter Hutterer
a2d83b9dc8 Xi: add "deletable" flag to properties, add DeleteProperty handler.
A property can only be deleted if any of the following is true:
- if a property is deletable and all handlers return Success.
- if a property is non-deleteable and the all handlers return Success AND the
  delete request does not come from a client (i.e. driver or the server).

A client can never delete a non-deletable property.
2008-09-26 13:32:08 +09:30
Peter Hutterer
22e9047268 Xi: allow Set/GetProperties to return a status, and honour this status code.
If a property handler now bails out, return the error code to the caller. This
allows to be slightly more specific with the errors.
2008-09-26 13:32:07 +09:30
Peter Hutterer
1e24e7b9df Xi: remove configure/query device property calls.
This removes all the meta-information about device properties (pending,
fromClient, range, valid_values, immutable).
2008-09-26 13:32:05 +09:30
Adam Jackson
991ed2949b Rename SaveSetMap() to SaveSetShouldMap().
Avoids preprocessor collision with xfixeswire.h
2008-09-23 10:22:22 -04:00
Owen Taylor
ca9fae0079 Change 'remap' to 'map' in saveset functions/macros
Now that the code has been fixed so that Unmap means unmap and not "don't
remap", 'remap' was confusing to have in the function names/parameters, so
change it to simple 'map'.

Signed-off-by: Keith Packard <keithp@keithp.com>
2008-09-22 12:43:30 -07:00
Owen W. Taylor
722c51960d Don't remap windows for SaveSetUnmap
Since ReparentWindow() does a unmap/map pair for windows that are already
mapped, for saveset windows with SaveSetUnmap, we must unmap the window
before calling ReparentWindow() to avoid the generation of MapRequest
events, and so forth.
2008-09-22 11:04:26 -04:00
Adam Jackson
0bb317a78b Default to -br. Add -retro option for the nostalgic.
-retro also reverts to the classic cursor display behavior, meaning,
the cursor will be visible before anyone calls XDefineCursor().
2008-09-22 10:51:51 -04:00
Julien Cristau
ab17f88506 Don't use our version of ffs() if the system has one 2008-09-22 02:49:15 +02:00
Peter Hutterer
e76b5b5e73 dix: calloc, not malloc, ValuatorClassRec.
For master devices, the ptraccel code could segfault on free since we'd be
dereferencing random memory. Callocing the valuatorClassRec is the easy fix.
2008-09-18 14:55:32 +09:30
Eamon Walsh
b6ab114212 Array-index based devPrivates implementation.
Note: DevPrivateKey is now pointer-to-int, which means
each key now needs to point to some global storage of
size at least sizeof(int).
2008-09-12 19:11:53 -04:00
Daniel Drake
4e1f9f51a9 Don't try to destroy a NULL pixmap. 2008-09-02 16:20:40 -04:00
Tomas Carnecky
ebea78cdba Prepare for array-index based devPrivates.
TODO: static indices can be made just an int; some indices
can be combined.
2008-08-28 18:05:40 -04:00
Eamon Walsh
ec7907f8fa Add an array of integers for use as per-screen cursor private keys.
Replaces the use of the screen pointer itself as the key, which was
nice but won't work now that an array index is being stored.
2008-08-27 19:27:13 -04:00
Adam Jackson
64ef7ed072 Centralize declaration of ConnectionInfo. 2008-08-20 13:14:34 -04:00
Peter Hutterer
609c04b62b dix: stick a warning in about loss of subpixel precision. 2008-08-15 14:52:13 +09:30
Adam Jackson
0ce687634f Eviscerate save-under support.
Use a compositing manager already.  Plus I really wanted to use 'eviscerate'
in a commit message.
2008-08-13 17:28:08 -04:00
Peter Hutterer
998375f415 dix: remove superfluous check. 2008-08-12 20:42:08 +09:30
Mathieu Bérard
9f9268821b The smart scheduler is not optional. 2008-08-11 13:52:38 -04:00
Matthieu Herrb
6e33e6f355 Move string comparaison functions to from dix/ to os/. 2008-08-09 23:51:39 +02:00
Peter Hutterer
465a9bb96e dix: don't try to create events if we don't have a screen. #16898
A NULL screen may happen during server shutdown, when the output has been shut
down but the devices still generate events.

X.Org Bug 16898 <http://bugs.freedesktop.org/show_bug.cgi?id=16898>
2008-08-08 17:37:06 +09:30
Simon Thum
e00cd54c1a dix: remove misleading comment in ptrvelo.c
Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
2008-08-08 16:19:20 +09:30
Peter Hutterer
6ca34549b8 dix: remove obsolete FIXME comment.
Thanks to Simon Thum for pointing this out.
2008-08-08 16:19:20 +09:30
Peter Hutterer
2c3645581e dix: SetModifierMapping should only apply to the ClientPointer and it's SDs. 2008-08-08 16:19:20 +09:30
Simon Thum
e1b286d495 dix: simplified debugging helper for pointer acceleration
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2008-08-08 16:19:20 +09:30
Simon Thum
4f333d5351 dix: simplify velocity tracking filters
prefer fp-mul over fp-div and remove rather pointless check

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2008-08-08 16:19:20 +09:30
Tomas Carnecky
277a74bcbb Redefine clients as a fixed array
This removes yet another xalloc() each server generation. Also, I
couldn't find the corresponding xfree() so I guess that used to be a
memory leak there.
2008-08-05 01:17:32 +03:00
Tomas Carnecky
5532d63488 Redefine WindowTable as a fixed array
Instead of xalloc'ing it every server generation. The array is always
the same size (MAXSCREENS), anyway.
2008-08-05 01:17:32 +03:00
Simon Thum
d762c08aeb dix: export driver-side functions for acceleration
also add additional safety for accel driver api

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2008-08-04 15:13:37 +09:30
Simon Thum
18e9fd69fe dix: use average of pointer accel profile
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2008-08-04 15:13:30 +09:30
Simon Thum
805f28e96c some trivial changes regarding C compat, indentation, etc.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2008-07-28 18:13:19 +09:30
Simon Thum
a17cb29f5a dix: preparation change: make runtime exchange of filter chain safe
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2008-07-28 18:13:19 +09:30