Commit Graph

500 Commits

Author SHA1 Message Date
Peter Hutterer
87ff1159b4 dix: deliver device enter/leave events. 2009-03-20 15:17:55 +10:00
Peter Hutterer
3f37923a72 Xi: send XI2 focus events. 2009-03-20 15:17:55 +10:00
Peter Hutterer
8b6a370058 Add XI2 masks and XISelectEvent() request handling.
XI2 event masks are simply stored in the OtherEventMasks as a separate field.
This replaces the XiSelectEvent code.
2009-03-20 15:17:55 +10:00
Peter Hutterer
38bba0c1b7 Xi: Change ChangeMasterDeviceClasses to new XI2 events.
Split ChangeMasterDeviceClasses into an extra XISendDeviceChangedEvent that
assembles the XI2 wire event for the DeviceChanged event. Re-use this when
detaching the last SD.

Not quite perfect yet, we still copy the device classes from the slave now
rather than from the data we had when the event occured. But it's a start.

(We can now unexport SizeDeviceInfo and CopySwapDevices, not needed anymore)

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-03-20 15:17:55 +10:00
Peter Hutterer
181e41511d dix: fix up device enter/leave for XI_Enter/XI_Leave. 2009-03-20 15:17:55 +10:00
Peter Hutterer
dfa2e8e966 Xi: add XIQueryDevice request handling. 2009-03-20 15:17:55 +10:00
Peter Hutterer
560c58b53e Xi: name-space and fix XI2 requests
All XI2 requests have XI prefixes.
Requests affected:
    ChangeDeviceCursor
    QueryDevicePointer
    WarpDevicePointer
    SetClientPointer
    GetClientPointer
    XIChangeDeviceHierarchy.
2009-03-20 15:17:55 +10:00
Peter Hutterer
903449615b Xi: add XIQueryVersion request handling. 2009-03-20 15:17:54 +10:00
Peter Hutterer
906fe95479 Xi: don't allow OpenDevice on any MD.
This restores the original behaviour of XI 1. Any slave device may be opened,
but none of the MDs.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-03-20 15:17:54 +10:00
Peter Hutterer
c7eb27f392 Xi: always only list VCP/VCK and the SD's in XListInputDevices.
If a client wants other MDs, it should use XI2's XQueryDevice() instead.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-03-20 15:17:54 +10:00
Peter Hutterer
801f14d4b7 Xi: don't send attachment info down with ListInputDevices. 2009-03-20 15:17:54 +10:00
Peter Hutterer
66dd8879b3 Xi: purge ExtendedGrabDevice request handling. 2009-03-20 15:17:54 +10:00
Peter Hutterer
43e48900fc dix: Force deviced ids of 2 and higher for actual devices.
0 is now reserved for the "AllDevices" virtual device.
1 is now reserved for the "AllMasterDevices" virtual device.

This also means that wherever we passed in (mskidx = 0), we now need to pass
in the deviceid.
2009-03-20 15:17:54 +10:00
Peter Hutterer
6b6b660c36 Xext: remove ev_fill from GEExtensions. 2009-03-20 15:17:54 +10:00
Peter Hutterer
445daa62e7 Xext: purge XGE event masks.
The masks were originally designed to generically handle event masks for
extensions. Since all that is in-server anyway, it's much better writing
custom event masks for those extensions that need it and not providing a
unified mechanism.
XI2 needs more than the current implementation, which is already too complex
for most other extensions. good riddance.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-03-20 15:17:53 +10:00
Peter Hutterer
6fe4c28bf4 Add agressive event type checking.
Best to FatalError if a wrong event comes in. At least that forces me to fix
it really quickly.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-03-20 15:17:53 +10:00
Peter Hutterer
5ae129baef Xi: check for existence of the button class before accessing it
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-03-20 14:48:57 +10:00
Peter Hutterer
d21a546e96 Xi: VCP and VCK may register for ext. events, so delete them if necessary. 2009-03-16 13:29:07 +10:00
Peter Hutterer
067f26f7ba Xi: set the modifier + group state during POE.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-03-12 11:03:29 +10:00
Peter Hutterer
da724e8f1d Xi: Set the button state on the event during POE.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-03-12 11:03:29 +10:00
Keith Packard
f8dd80d13b Replace dixLookupResource by dixLookupResourceBy{Type,Class}
dixLookupResource attempted to automatically detect whether the caller
wanted a lookup by-type or by-class, unfortunately, it guessed wrong for
RT_NONE. Instead of trying to make the guess better, this patch just reverts
the unification and creates separate functions for each operation.
2009-03-09 13:08:09 -07:00
Peter Hutterer
0d9a42dc03 Xi: don't crash on a NULL property name, just return None.
strcmp doesn't like NULL-pointers.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-03-09 14:01:54 +10:00
Peter Hutterer
432a95032e Remove useless (void) typecasts.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-03-09 14:01:54 +10:00
Peter Hutterer
a706dd8771 include: add a range of button labels.
Mostly the same buttons as defined by linux/input.h, with five exceptions:
"Button Unknown" for a button that cannot be labelled.
"Button Wheel Up", "Button Wheel Down" for buttons 4/5, traditionally the
wheel buttons.
"Button Horiz Wheel Up", "Button Horiz Wheel Down" for buttons 6/7,
traditionally the horiz. wheel buttons.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Daniel Stone <daniel@fooishbar.org>
2009-03-03 07:07:30 +10:00
Peter Hutterer
5672e2d664 Xi: remove AllExtensionVersions.
Keeping an AllExtensionVersions array to save all versions of
all extension is rather pointless if only one extension uses it.
Rename to XIVersion, reduce to a single struct.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-02-25 14:58:08 +10:00
Peter Hutterer
b3412adca8 Xi: don't need to set the XKB settings for new core devices.
This is done by the XKB code these days anyway, so we might as well ignore it
and keep using the stanard stuff.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-02-25 14:50:48 +10:00
Peter Hutterer
763848d3ab Input: change processing API to InternalEvents.
Don't pass xEvent* and count through to processing, pass a single
InternalEvent.

Custom handlers are disabled for the time being. And for extra fun,
XKB's pointer motion emulation is disabled. But stick an error in there so
that we get reminded should we forget about it.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-02-23 17:52:40 +10:00
Peter Hutterer
a371853698 dix: Deliver{Grabbed|Focused|Device}Events API changed to InternalEvents.
With the API change, we can now purge the XI conversion from POE.

Note: this commit breaks DGA even more.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-02-23 17:52:39 +10:00
Peter Hutterer
8f94ec6f78 dix: convert passive grabs to use internal events.
deviceGrab.sync.event is now an internal event, and CheckDeviceGrabs and
friends is changed over.

Note that this currently breaks some frozen grabs. See towards the end of
ComputeFreezes().

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-02-23 17:52:39 +10:00
Peter Hutterer
75595ba4aa Xi: make ProcessOtherEvents more InternalEvent aware.
Get rid of the deviceValuator processing and a few other things, but still
drop back into XI before checking device grabs or doing anything else.

NoticeEventTime now needs to take InternalEvents, and while we're at it,
change NoticeTime from a macro to a function.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-02-23 17:52:39 +10:00
Peter Hutterer
3a02e538db dix: update CheckMotion to deal with DeviceEvents.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-02-23 17:52:39 +10:00
Peter Hutterer
8829d966a6 Xi: support InternalEvents in UpdateDeviceState, parts of POE and EnqueueEvent
Note that this breaks DGA. Life is tough.

EnqueueEvent is a somewhat half-baked solution, we immediately drop back into
XI and store them. But it should in theory work.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>

Don't let the dcce be random data.
2009-02-23 17:52:39 +10:00
Peter Ã…strand
ddb8d8945d xserver: Avoid sending uninitialized padding data over the network
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-02-16 13:28:38 +10:00
Peter Hutterer
772e0f9159 dix: Don't set core events in SetMaskForEvent.
Rather, modify the two callers to call separately for the two different.
events. Unexport SetMaskForEvent too.
And while we're at it, get rid of the MotionFilter macro, because it's one
half confusing and one half pointless.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-02-16 13:28:17 +10:00
Peter Hutterer
58f3127919 Xi: remove dynamic mask assignment for XI events.
They end up being the same anyway on startup, so let's not have a dynamic mask
assignment mechanism and instead just hardcode them already.
Also unexport SelectForWindow and remove the valid_masks parameter. We can
check that before calling, since there's only one caller anyway.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-02-16 13:28:17 +10:00
Peter Hutterer
9f3c5d46f8 Xi: initialize the device before applying button map changes.
This part got lost in bc909f7136.
Reported by Tomas Carnecky.

Acked-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-02-03 11:12:01 +10:00
Simon Thum
6bf6a4c47e Xi: create well-known atoms on demand, rather than preinit them
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-02-03 08:51:11 +10:00
Peter Hutterer
32adf8d34f Xi: If the MD doesn't have a key/kbdfeed class, init the keyboard.
This fixes crashes on mouse/keyboard combos where the mouse is both a keyboard
and a mouse. Upon copying the SD's key info into the VCP, the NULL xkbInfo of
the VCP would crash the server.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-02-03 08:51:11 +10:00
Peter Hutterer
caade11b84 Xi: remove now obsolete oldXkbInfo.
Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
2009-02-03 08:51:11 +10:00
Maarten Maathuis
3903e23153 XKB: ifdef XKB is dead, yet it was still present in a few places. 2009-01-29 12:42:57 +01:00
Peter Hutterer
01ffaf6834 Xi: define a range of axis labels.
This is copied from linux/input.h, presumably that's the ones at least the
Linux kernel can give us for any device.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-01-23 08:09:29 +11:00
Daniel Stone
b5ece46b76 Input: Clarify valuator FatalError messages
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-01-22 15:09:00 +11:00
Daniel Stone
ddb46c1421 Input: Use previous state in valuator events
Make valuator event state match other events by using the device state
from before processing the event, not after.  Also, we already check the
number of valuators in UpdateDeviceState, so no need to do it again.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-01-22 15:09:00 +11:00
Daniel Stone
c05f3bc935 Input: Don't allow DDX to generate repeat events
We always use soft-repeat at the moment; XKB posts a release/press sequence,
which admittedly needs cleaning up, but that's for another day.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-01-22 15:09:00 +11:00
Daniel Stone
4fa3872dc2 Input: Remove core keysyms from KeyClassRec
Instead of always keeping two copies of the keymap, only generate the
core keymap from the XKB keymap when we really need to, and use the XKB
keymap as the canonical keymap.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-01-22 15:08:59 +11:00
Daniel Stone
bc909f7136 Input: Centralise pointer map changing
Replace both core and Xi functions with one function that validates the
proposed map, and sends out both kinds of notification.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-01-22 15:08:58 +11:00
Daniel Stone
f06a9d2e05 Input: Clean up keymap change notifications
Keyboard map notifications are always generated from within XKB code,
which also takes care of copying the keysyms, etc.  If you need to
mangle the keymap yourself, generate a new core keymap/modmap, and pass
it to XkbApplyMappingChange.

SendMappingNotify is renamed to SendPointerMappingNotify (and ditto its
Device variants), which still only _sends_ the notifications, as opposed
to also doing the copying a la XkbApplyMappingChange.

Also have the modmap change code traverse the device hierachy, rather
than just going off the core keyboard.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2009-01-22 15:08:58 +11:00
Daniel Stone
1d1a0f67ee Xi: Introduce XIShouldNotify
XIShouldNotify just lets you know if you should send an event for a
keymap change (or similar) concerning a given device to a given client;
at the moment, this is only for devices which are sending events to that
client.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-01-22 15:08:58 +11:00
Daniel Stone
32db27a7f8 Input: Remove modifierMap from core
We already have modmap (in the exact same format!) in XKB, so just use
that all the time, instead of duplicating the information.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-01-22 15:08:55 +11:00
Daniel Stone
f062e90a95 Input: Remove modifierKeyMap
Since modifierKeyMap is generated from modifierMap, just remove it, and
only generate it when we need to send the modifier map to the client.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-01-22 15:08:55 +11:00
Daniel Stone
cf6a2fc2bd Input: Ignore modifiers in core input processing
Modifiers get cleared by the XKB code when we drop down into core input
processing, so just delete the dead code path to simplify things a bit.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-01-22 15:08:55 +11:00
Daniel Stone
6727ee9408 Input: Remove state from KeyClassRec
We already have state fully stored within XKB, so instead of duplicating it,
just generate the values to send to clients when required.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-01-22 15:08:55 +11:00
Daniel Stone
08363c5830 Input: Overhaul keyboard initialisation process
XkbInitKeyboardDeviceStruct is now the only valid keyboard
initialisation: all the details are hidden behind here.  This now makes
it impossible to supply a core keymap at startup.

If dev->key is valid, dev->key->xkbInfo->desc is also valid.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-01-22 15:08:51 +11:00
Daniel Stone
40877c6680 XKB: Make XKB mandatory
No more #ifdef XKB, because you can't disable the build, and no more
noXkbExtension either.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-01-22 15:06:25 +11:00
Daniel Stone
07c3bb922b XKB: Move XkbCopyKeymap definition to xkbsrv.h
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-01-20 15:32:18 +11:00
Peter Hutterer
58a6b5b9ef Xi: don't care about CoreDevicePrivateKey when copying keys
If we get here, we must copy.

Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2009-01-20 15:32:18 +11:00
Thomas Jaeger
717a961528 Don't release grabs unless all buttons are up
Previously, only buttons <= 5 would count here, but the core protocol
allows for 255 buttons.

http://lists.freedesktop.org/archives/xorg/2009-January/042092.html

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-01-16 11:46:26 +10:00
Thomas Jaeger
f7f85f6965 Count the number of logically down buttons in buttonsDown
This fixes the following bug.  Assuming your window manager grabs
Alt+Button1 to move windows, map Button3 to 0 via XSetPointerMapping,
then press the physical button 3 (this shouldn't have any effect), press
Alt and then button 1.  The press event is delivered to the application
instead of firing the grab.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-01-16 10:43:53 +10:00
Simon Thum
19275ea8e9 dix: add property support for pointer acceleration.
Note: properties don't need to be cleaned up, the DIX does it for us anyway.
Data that is stored in properties is cleaned up by the property system.
Handlers, etc. don't need to be unregistered while cleaning up, as they get
deleted when the device is removed anyway.

Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
Signed-off-by: Simon Thum <simon.thum@gmx.de>
2009-01-15 09:28:55 +10:00
Peter Hutterer
a48c81dcdf Xi: add XATOM_FLOAT to server-defined properties.
This property is used to denote type float for input properties. Such
properties can be accessed easily through the XIPropToFloat() function.

Code originally written by Simon Thum.

Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
2009-01-12 12:55:27 +10:00
Peter Hutterer
669f6810af Xi: add XIPropToInt() auxiliary function.
Converts an XIPropertyValuePtr to an integer, provided that type and format is
right.

Code originally written by Simon Thum.

Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
2009-01-12 12:55:27 +10:00
Julien Cristau
e64473b14e Xi: fix missing declaration of XkbSetRulesDflts 2009-01-11 08:54:10 +01:00
Peter Hutterer
9bf77569cc Xi: call CheckMotion for floating SDs too.
CheckMotion updates the sprite position so we need to call it for all devices
that have a sprite - including floating SDs (which have an invisible sprite).
2009-01-09 16:09:20 +10:00
Christian Beier
f8ecc2f08f Xi: fix typo in WarpDevicePointer handling.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-01-08 11:45:22 +10:00
Peter Hutterer
aeff14d5f2 dix: don't alloc in ChangeMasterDeviceClasses.
We mustn't realloc as we are inside a signal handler. With
SetMinimumEventSize, this code should never be hit anyway, as the event list
should have the required memory before this code is hit.

Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
2008-12-12 11:43:32 +10:00
Peter Hutterer
fb2a8d0e59 Xi: silence compiler warning
Don't mix declarations and statements.
2008-12-12 11:43:32 +10:00
Peter Hutterer
cb95642dc8 Remove #define NEED_EVENTS and NEED_REPLIES
A grep on xorg/* revealed there's no consumer of this define.

Quote Alan Coopersmith:
"The consumer was in past versions of the headers now located
in proto/x11proto - for instance, in X11R6.0's xc/include/Xproto.h,
all the event definitions were only available if NEED_EVENTS were
defined, and all the reply definitions required NEED_REPLIES.

Looks like Xproto.h dropped them by X11R6.3, which didn't have
the #ifdef's anymore, so these are truly ancient now."

Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2008-12-12 11:43:32 +10:00
Tom Jaeger
78a62d7713 Xi: XIGetDevice needs to ignore the MORE_EVENTS flag.
Reported in X.Org Bug 18882, Comment 5.
<http://bugs.freedesktop.org/show_bug.cgi?id=18882>

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2008-12-08 12:05:54 +10:00
Peter Hutterer
fd2d40b7ec Xi: change XIUnRegisterPropertyHandler to XIUnregisterPropertyHandler
CamelCase can be taken too far, and AFAICT there's no consumers of that
function yet anyway.

Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
2008-12-03 20:25:15 +10:00
Paulo Cesar Pereira de Andrade
49f77fff14 Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.

  This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)

  LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.

  xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 05:43:34 -02:00
Peter Hutterer
9c5dd7337f Let the DDX decide on the XkbRulesDefaults.
Rather than assuming rules in the CoreKeyboardProc, init the default rules in
InitCoreDevices, then re-use them later.

In the xfree86 DDX, set the rules to "base" or "evdev", depending on whether
we'll load kbd or evdev.

If we create a new MD, use pc105,us as default and re-use the rules file used
previously.

Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
2008-12-03 16:10:40 +10:00
Peter Hutterer
9bf761468f Xi: fix xi_filters size. 2008-12-02 15:50:38 +10:00
Peter Hutterer
a85f0d6b98 Xi: fix use of button->down - bitflags instead of int arrays.
The device's button down state array was changed to use DOWN_LENGTH and thus
bitflags for each button in cfcb3da7.

Update the DBSN events to copy this bit-wise state.
Update xkb and Xi to check for the bit flag instead of the array value.

Reported by ajax.

Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
2008-12-02 15:50:37 +10:00
Paulo Cesar Pereira de Andrade
d6cbd4511e Export symbols defined in the sdk.
This is the biggest "visibility" patch. Instead of doing a "export"
symbol on demand, export everything in the sdk, so that if some module
fails due to an unresolved symbol, it is because it is using a symbol
not in the sdk.

  Most exported symbols shouldn't really be made visible, neither
advertised in the sdk, as they are only used by a single shared object.

  Symbols in the sdk (or referenced in sdk macros), but not defined
anywhere include:
XkbBuildCoreState()
XkbInitialMap
XkbXIUnsupported
XkbCheckActionVMods()
XkbSendCompatNotify()
XkbDDXFakePointerButton()
XkbDDXApplyConfig()
_XkbStrCaseCmp()
_XkbErrMessages[]
_XkbErrCode
_XkbErrLocation
_XkbErrData
XkbAccessXDetailText()
XkbNKNDetailMaskText()
XkbLookupGroupAndLevel()
XkbInitAtoms()
XkbGetOrderedDrawables()
XkbFreeOrderedDrawables()
XkbConvertXkbComponents()
XkbWriteXKBSemantics()
XkbWriteXKBLayout()
XkbWriteXKBKeymap()
XkbWriteXKBFile()
XkbWriteCFile()
XkbWriteXKMFile()
XkbWriteToServer()
XkbMergeFile()
XkmFindTOCEntry()
XkmReadFileSection()
XkmReadFileSectionName()
InitExtInput()
xf86CheckButton()
xf86SwitchCoreDevice()
RamDacSetGamma()
RamDacRestoreDACValues()
xf86Bpp
xf86ConfigPix24
xf86MouseCflags[]
xf86SupportedMouseTypes[]
xf86NumMouseTypes
xf86ChangeBusIndex()
xf86EntityEnter()
xf86EntityLeave()
xf86WrapperInit()
xf86RingBell()
xf86findOptionBoolean()
xf86debugListOptions()
LoadSubModuleLocal()
LoaderSymbolLocal()
getInt10Rec()
xf86CurrentScreen
xf86ReallocatePciResources()
xf86NewSerialNumber()
xf86RandRSetInitialMode()
fbCompositeSolidMask_nx1xn
fbCompositeSolidMask_nx8888x0565C
fbCompositeSolidMask_nx8888x8888C
fbCompositeSolidMask_nx8x0565
fbCompositeSolidMask_nx8x0888
fbCompositeSolidMask_nx8x8888
fbCompositeSrc_0565x0565
fbCompositeSrc_8888x0565
fbCompositeSrc_8888x0888
fbCompositeSrc_8888x8888
fbCompositeSrcAdd_1000x1000
fbCompositeSrcAdd_8000x8000
fbCompositeSrcAdd_8888x8888
fbGeneration
fbIn
fbOver
fbOver24
fbOverlayGeneration
fbRasterizeEdges
fbRestoreAreas
fbSaveAreas
composeFunctions
VBEBuildVbeModeList()
VBECalcVbeModeIndex()
TIramdac3030CalculateMNPForClock()
shadowBufPtr
shadowFindBuf()
miRRGetScreenInfo()
RRSetScreenConfig()
RRModePruneUnused()
PixmanImageFromPicture()
extern int miPointerGetMotionEvents()
miClipPicture()
miRasterizeTriangle()
fbPush1toN()
fbInitializeBackingStore()
ddxBeforeReset()
SetupSprite()
InitSprite()
DGADeliverEvent()

  SPECIAL CASES
o defined as _X_INTERNAL
	xf86NewInputDevice()
o defined as static
	fbGCPrivateKey
	fbOverlayScreenPrivateKey
	fbScreenPrivateKey
	fbWinPrivateKey
o defined in libXfont.so, but declared in xorg/dixfont.h
	GetGlyphs()
	QueryGlyphExtents()
	QueryTextExtents()
	ParseGlyphCachingMode()
	InitGlyphCaching()
	SetGlyphCachingMode()
2008-11-29 23:56:06 -02:00
Peter Hutterer
de1a8b68eb xkb: extract the correct device in XkbFilterEvents.
If the event is an XI event, we need to work on the correct device, not on
the VCK.

Adds XIGetDevice(event) function to extract the device from an event.
2008-11-04 16:04:16 +10:30
Peter Hutterer
d972399566 Purge device-based WindowAccess code.
Really, this was a bad idea. It's not security, the UI features that would
have been cool (e.g. clicking through windows) aren't implemented anyway, and
there's nothing you can't achieve just by using plain XI anyway.

Requires inputproto 1.9.99.6.
2008-11-04 16:04:15 +10:30
Peter Hutterer
b6b26560d6 Move EXTENSION_BASE and EXTENSION_EVENT_BASE to misc.h. 2008-10-31 17:09:13 +10:30
Peter Hutterer
f781a752e6 Move MAX_DEVICES to misc.h, rename to MAXDEVICES for consistency. 2008-10-31 17:09:13 +10:30
Julien Cristau
add946daed Nuke unused variables 2008-10-26 11:44:10 +01:00
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
4808bdec45 Xi: don't memcpy the KeyClassRec from SD to MD. #16167
Most of its component get copied during CopyKeyClass anyway.
The ones that aren't:
  postdown - never changed for virtual devices anyway.
  down - shouldn't change that without sending events.

memcpy'ing the struct also copied mapWidth, which means we didn't realloc
during SetKeySymsMap lateron, overwriting the memory assigned to us.

X.Org Bug 16167 <http://bugs.freedesktop.org/show_bug.cgi?id=16167>
2008-10-10 16:58:08 +10:30
Adam Jackson
c6d6d3e87a Loader: Unexport a handful of consumerless symbols from dixsym. 2008-10-06 16:18:21 -04:00
Adam Jackson
0b7b89fbac xalloc+bzero -> xcalloc 2008-10-06 14:19:30 -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
Peter Hutterer
cc20112a65 Xi: don't include client-side headers.
Spotted by Mikhail Gusarov.
2008-09-19 08:45:43 +09:30
Peter Hutterer
f789408f7d Xi: remove broken SDeviceEnterNotifyEvent, replace with ...Leave...
The event format is the same for both (bar the type), so one is enough.
2008-09-18 13:32:57 +09:30
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
Peter Hutterer
95b466e457 Xi: don't include .c files. 2008-08-22 21:38:01 +09:30
Peter Hutterer
c696da75c7 Xi: swap devices property replies. 2008-08-22 21:38:01 +09:30
Peter Hutterer
de1573172a Backport device properties to XI 1.5 instead of XI 2.0 2008-08-15 14:52:13 +09:30
Peter Hutterer
e6813e8de6 Xi: byte-swap device property requests. 2008-08-14 15:01:18 +09:30
Peter Hutterer
139c3ab7b7 Xi: return the state from the correct keyboard in QueryDevicePointer. 2008-08-12 20:42:08 +09:30
Peter Hutterer
591ef3c047 Xi: ChangeDeviceControl presence events should set the appropriate devchange.
Requires inputproto 1.4.4 or higher.
2008-07-29 10:00:01 +09:30
Adam Jackson
d6228cb22a Shape extension is built-in and mandatory. 2008-07-24 15:46:08 -04:00
Peter Hutterer
5bcc45e07e Xi: expose Enable/DisableDevice through XI_PROP_ENABLED property. 2008-07-13 20:54:33 +09:30
Peter Hutterer
e7abe1676a Xi: protect against NULL handlers, don't try to dereference. 2008-07-13 20:54:33 +09:30
Peter Hutterer
2bbb12c355 Xi: remove ChangeDeviceControl for CoreCtl.
If you want to set a device to core, attach it to a master device.
2008-07-13 20:54:33 +09:30
Peter Hutterer
18ff17756c Xi: GetDeviceProperty reply includes deviceid. 2008-07-13 20:54:33 +09:30
Peter Hutterer
e4054e5cb3 Xi: pack the property stuff into a struct, make handlers a linked list.
We may need more than one handler to deal with a property (e.g. one in the
driver, one in the DIX), so get the handlers into a linked list and call them
one-by-one. This is of course slightly less entertaining than the hilarious
WRAP/UNWRAP game we play in other parts of the server.

XIRegisterPropertyHandler/XIUnregisterPropertyHandler are the interface
drivers/the DIX should use to attach themselves to the device.

XIDeleteAllDeviceProperties destroys everything, including the handlers.
2008-07-10 16:28:44 +09:30
Peter Hutterer
2039c6ea43 Xi: add support for input device properties.
Basically just copied from randr properties, with minor changes only.
Each device supports arbitrary properties that can be modified by clients.
Modifications to the properties are passed to the driver (if applicable) and
can then affect the configuration of the device.

Note that device properties are limited to a specific device. A property set
on a slave device does not migrate to the master.
2008-07-10 16:28:34 +09:30
Peter Hutterer
4ab01fe5db Revert "Xi: add support for input device properties."
Note to self: don't mix up branches with half-finished cherrypicks.

This reverts commit 666838fcc8.
2008-07-10 16:27:36 +09:30
Peter Hutterer
666838fcc8 Xi: add support for input device properties.
Basically just copied from randr properties, with minor changes only.
Each device supports arbitrary properties that can be modified by clients.
Modifications to the properties are passed to the driver (if applicable) and
can then affect the configuration of the device.

Note that device properties are limited to a specific device. A property set
on a slave device does not migrate to the master.
2008-07-10 16:02:55 +09:30
Peter Hutterer
acce270935 Xext: store the GenericMasks in the resource system.
This fixes a severe issue - when the client died the event mask didn't get
unregistered and a future event would dereference dangling pointers. By
storing the event masks in the resource system we can free them when the
client dies.
2008-07-10 16:02:55 +09:30
Peter Hutterer
15e4b6c574 input: for non-device events (e.g. DevicePresence) use MAX_DEVICES as id.
Using id = 0 only worked pre-MPX since XInput didn't allow XOpenDevice for the
core devices (0 and 1). Now we can now legally register for events so we may
overwrite our device-independent classes with the ones selected for the VCP.

So, increase the EMASKSIZE to MAX_DEVICES + 1 and use MAX_DEVICES as the ID
when we don't have a device.
2008-06-26 12:53:05 +09:30
Keith Packard
cfcb3da75e Make button down state a bitmask. Master buttons track union of slave buttons
Mixing usage where some parts of the code treated this field as a bitmask
and other parts as an array of card8 was wrong, and as the wire protocol
wanted bitmasks, it was less invasive to switch the newer counting code use
booleans.

Master devices track slave buttons by waiting for all slave buttons to be
released before delivering the release event to the client.

This also removes the state merging code in DeepCopyDeviceClasses -- that
code was changing master device state without delivering any events,
violating protocol invariants. The result will be that existing slave
button state which does not match the master will not be visible through the
master device. Fixing this would require that we synthesize events in this
function, which seems like a bad idea. Note that keyboards have the same
issue.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Peter Hutterer <peter@cs.unisa.edu.au>
2008-06-19 17:41:00 +09:30
Peter Hutterer
d21155a3e9 input: fix up usage of button->down, used to be a bitmask, is now an array.
device->button->down used to be a 32-byte bitmask with one bit for each
button. This has changed into a 256-byte array, with one byte assigned for
each button. Some of the callers were still using this array as a bitmask
however, this is fixed with this patch.

Thanks to Keith Packard for pointing this out. See also:
http://lists.freedesktop.org/archives/xorg/2008-June/036202.html
2008-06-18 10:17:08 +09:30
Peter Hutterer
2b9c829bde Xi: don't drop the grab status in XExtendedGrabDevice(). 2008-06-18 10:07:37 +09:30
Keith Packard
8c9234a163 Xi: avoid double button mapping.
Button events were mapped once in GetPointerEvents and then again in
UpdateDeviceState. While it might make sense to just fix up UpdateDeviceState,
it turns out to be better to leave the raw button number in the event because
DGA reports raw device events without button translation, and so when it calls
UpdateDeviceState, the button down counts get scrambled and buttons get stuck
down.

See also:
http://lists.freedesktop.org/archives/xorg/2008-June/036201.html

Signed-off-by: Peter Hutterer <peter@cs.unisa.edu.au>
2008-06-15 11:47:24 +09:30
Eamon Walsh
61dafe384a Fix "warning: unused variable `tsize'". 2008-06-13 22:47:10 -04:00
Eamon Walsh
37a64b02df Fix "warning: ‘rc’ may be used uninitialized in this function". 2008-06-13 22:46:51 -04:00
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
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
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
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
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
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
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
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
28378d26b4 Xi: assemble button/modifier state before updating the device. #15934
The state field of the event must specify the state of the devices before the
event occured. With the code as it was, the state would also include the
event (e.g. state from a button press event would show the button as pressed)
Gathering the state before updating the device should fix this.

X.Org Bug 15934 <http://bugs.freedesktop.org/show_bug.cgi?id=15934>
2008-05-16 15:42:57 +09:30
Peter Hutterer
59b8d29b3a Xi: Fix up ProcIVector, got out of sync with the protocol.
When the opcode squash happened in the protocol, the processing vector got out
of sync for a few requests. As a result, client and server would interpret
requests differently, leading to a couple of BadLength problems.
2008-05-13 11:17:02 +09:30
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
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
18b33dd4ff Xi: stop excessive use of _X_EXPORT. 2008-04-29 15:24:55 +09:30
Peter Hutterer
8208b842b7 Xi: add IEventBase global variable. Stores event base for X Input events. 2008-04-29 14:19:42 +09:30
Peter Hutterer
46340b7406 Xi: change UpdateDeviceState to be _X_EXPORT. 2008-04-29 14:17:48 +09:30
Peter Hutterer
3a922c5d07 Xi: apply ValuatorEvent data to the device's valuators.
After UpdateDeviceState, the device has the current position in absolute
coordinates, the event has the correct valuator data to be delivered to the
client.
2008-04-29 11:18:35 +09:30
Peter Hutterer
b5004722a2 Xi: Only return VCP, VCK and floating SDs to Xi 1.x clients.
This is better than the approach implemented with
8973a3f798 which disabled XI altogether for 1.x.
Instead, return a device list that resembles a traditional XI setup on pre XI
2.0 servers. If the client tries to open a device other than a floating SD,
return a BadDevice error.
2008-04-28 10:26:01 +09:30
Peter Hutterer
684b5d8382 Xi: whoops, stray ! caused a bit of memory mess. 2008-04-26 19:55:59 +09:30
Peter Hutterer
87071b604c Revert "Xi: disable XI for clients < XI 2.0"
Turns out some programs don't like this change. gnome-settings-daemon crashes
hard if you tell it that XI doesn't exist. So, tell them we have XI, but leave
the other change (the one that pretends no devices are available).

This reverts commit 8973a3f798.
2008-04-26 19:37:57 +09:30
Peter Hutterer
7447a30fb2 Xi: if a pre-XI2 client tries to list the devices, pretend we don't have any.
XI 1.x isn't supported anymore, so let's pretend we don't have any devices.
This stops clients from opening them and thus stops interference.
2008-04-26 19:03:13 +09:30
Peter Hutterer
8973a3f798 Xi: disable XI for clients < XI 2.0
Sorry. With the huge changes in the device handling I honestly don't know how
to support XI and XI2 alongside. So let's just pretend XI doesn't exist if a
client doesn't request it supporting XI2.
2008-04-26 19:01:00 +09:30
Peter Hutterer
b304b0a65c Xi: add versioning support.
Remember the version the client sent to us, so we can adjust our replies
accordingly. This requires the client to use the {major|minor}Version fields
in the GetExtensionVersion request. However, they were padding before, so we
must assume they are garbage if nbytes is non-zero. If nbytes is zero, the
client is probably a new client and we can handle it correctly.
2008-04-26 17:47:15 +09:30
Peter Hutterer
be5ff2b8d8 Xi: remove some superflous code 2008-04-25 16:25:13 +09:30
Peter Hutterer
f5ac98747d Standardise copyright headers for all new files created as part of MPX. 2008-04-25 14:50:24 +09:30
Peter Hutterer
3fc67b4205 Xi: remove leftover chpkpair.h file.
Used to contain declarations for ChangePointerKeyboardPairing request
handling.
2008-04-25 14:30:46 +09:30
Peter Hutterer
c14b858aec Xi: fix two compiler warnings
unused variable in exevents.c
implicit declaration in warpdevp.c
2008-04-25 14:29:05 +09:30
Peter Hutterer
6015b7a812 Xi: handle requests through a dispatch handler.
Same principle as e.g. in the RandR extension, rather than having a load of
    if (type == XI_whatever)
use an array of function pointers.
2008-04-25 14:28:45 +09:30
Peter Hutterer
cb8cb87bc6 Xi: remove unused #define DISPATCH 2008-04-25 14:28:25 +09:30
Peter Hutterer
f377141912 Xi: don't attempt to send to a NULL window.
Only applicable when the server comes down/restarts. In this case,
WindowTable[i] may be NULL. Let's not try to send an event then.
2008-04-24 14:19:28 +09:30
Peter Hutterer
aa6687322d Xi: when copying button classes, copy xkb_acts as well.
This should be the last piece in the quest for the class copy.
2008-04-18 14:39:21 +09:30
Peter Hutterer
51c8fd69ec dix: free the unused device classes when closing a device.
This also requires to NULL-ify all pointers while we're actually using them,
otherwise we'd try to free them twice.
2008-04-15 15:09:40 +09:30
Peter Hutterer
4cf9c5909d Xi: fix up button count.
Some leftover code from the previously used alloc/free device classes left us
with a incorrect button count. So a button release didn't come through if
a different pointer was moved after the button press.
2008-04-15 13:56:11 +09:30
Peter Hutterer
6866e84e3c Xi: store feedback classes in devProviates system as well.
This is a follow-up to cb48d88085.
2008-04-13 19:57:51 +09:30
Peter Hutterer
cb48d88085 Xi: store unused classes in devPrivates.
Rather than freeing/allocing classes each time the device capabilities need to
swap, store them in the devPrivates system.
When a class is unused, it is pushed into the devPrivates, and later recovered
when needed again. This saves us a lot of memory allocations/frees, admittedly
on the cost of some memory.
2008-04-13 19:48:28 +09:30
Peter Hutterer
fde3c83662 Xi: copy the KeySyms.map over from the source. 2008-04-13 17:10:18 +09:30
Peter Hutterer
3c4c9938f3 Xi: Fix pointer handling in KeyClassRec copy.
We don't free the class anymore, so just store the previous pointers, do the
memcpy from the SD and then restore the pointers.
Plugs a memleak too, before xkbInfo was never freed.
2008-04-13 17:00:00 +09:30
Peter Hutterer
6faf5b97b9 Xi: fix up modifierKeyMap copying.
Setting it to NULL isn't correct either. The correct behaviour is to realloc
it to the size necessary (or newly alloc it/free it).  Otherwise we have a
memleak.
2008-04-13 16:28:31 +09:30
Peter Hutterer
415c6df0da Xi: copy feedback classes first, in some cases xkb relies on kbdfeed.
XkbInitIndicatorMap (in XkbInitDevice) calls XkbFindSrvLedInfo. This accesses
the devices kbdfeed struct, which is all nice and dandy if it is NULL. When
copying the device classes however, kbdfeed may not be NULL and thus
XkbFindSrvLedInfo goes on its merry way to do whatever it does.

By copying kbdfeed first, we avoid XkbFSLI to reference the "old" kbdfeed
struct of the previous SD.
2008-04-13 11:46:44 +09:30
Peter Hutterer
961f666090 Xi: modifierKeyMap needs to be set to NULL when copying classes.
Otherwise we have a double reference to the same memory area.
2008-04-13 09:31:16 +09:30
Peter Hutterer
bf6679cba4 Xi: copy the XkbSrvLedInfo too when copying device classes. 2008-04-13 09:29:32 +09:30
Peter Hutterer
a88386ee27 Xi: only DeliverFocusedEvents if the event is not a pointer event.
A pointer device may have a focus class, but even if so, pointer events must
be delivered to the sprite window, not the focus window.
2008-04-10 14:42:26 +09:30
Peter Hutterer
4824942527 Xi: dont copy FocusClassRec if the master already has one.
Blindly copying will override the focus setting of the master. If there's XI
applications running, they may set the SD focus, while leaving the
MD's focus as it was. In this case, after a class swap we still want to get
the MD's events to the same window as before.
2008-04-10 14:36:10 +09:30
Peter Hutterer
5a4c6621aa Xi: some extra checks for validity of kbd and mouse.
Floating SDs are paired with themselves, so the paired device may not be a
proper keyboard or mouse. Put some extra checks in to avoid dereferencing a
nullpointer later.
2008-04-10 08:29:05 +09:30
Peter Hutterer
e7211eb0b3 Xi: When attaching, check for ptr -> ptr and keybd -> keybd.
Some pointer devices have key classes (e.g. MS Optical Desktop 2000). The
previous test was performed as Error if ptr -> keybd or keybd -> ptr. This
doesnt work with such devices. New test is Succeed if ptr->ptr or
keybd->keybd.
2008-04-10 08:08:54 +09:30
Peter Hutterer
389dae73cc Xi: If device "to" has a class but "from" doesn't, free the class in "to". 2008-04-09 08:26:00 +09:30
Peter Hutterer
60c38d248c Xi: plug memory leak, free previous motion history before allocating new. 2008-04-09 07:47:34 +09:30
Peter Hutterer
ea05cf0813 Xi: check if source has a key class before copying. 2008-04-08 22:09:11 +09:30
Peter Hutterer
fd06e8f8c1 Merge branch 'master' into dcdc_rework
Conflicts:

	Xext/xevie.c
	dix/dispatch.c
2008-04-07 07:56:41 +09:30
Peter Hutterer
8f38feb3e4 Xi: add comments for DeepCopyDeviceClasses, ChangeMasterDeviceClasses. 2008-04-05 20:37:21 +10:30
Peter Hutterer
d0395a7530 Xi: realloc to->valuator instead of allocing it blindly. 2008-04-04 15:05:26 +10:30
Peter Hutterer
502689847b Xi: ALLOC_COPY_CLASS_IF should only alloc if to->field doesn't exist. 2008-04-04 15:01:53 +10:30
Peter Hutterer
035b1b6995 Xi: remove duplicate copying of kbdfeed and ptrfeed. 2008-04-04 15:00:06 +10:30
Peter Hutterer
52fc7aed18 Xi: only alloc memory for feedback classes if it doesn't already exist. 2008-04-04 14:47:23 +10:30
Peter Hutterer
4eb87c8693 Xi: don't free device classes before copying them.
First commit in a series to come.
2008-04-04 14:20:37 +10:30
Peter Hutterer
8e562fe26f Xi: remove false memset from DeepCopyDeviceClasses.
It's wrong, needs to be different, but I haven't had enough coffee to figure
out what it needs to do yet.
2008-03-05 15:11:41 +10:30
Peter Hutterer
7b4f3616f7 Xi: add deviceid to QueryDevicePointer request.
Why not, we had the padding anyway.
Suggested by Jim Gettys on the X.Org mailing list.
2008-03-04 18:29:15 +10:30
Peter Hutterer
4f2cd0ed96 Merge branch 'master' into mpx
This merge reverts Magnus' device coorindate scaling changes. MPX core event
generation is very different, so we can't scale in GetPointerEvents.

Conflicts:

	Xi/opendev.c
	dix/devices.c
	dix/dixfonts.c
	dix/getevents.c
	dix/resource.c
	dix/window.c
	hw/xfree86/common/xf86Xinput.c
	mi/mipointer.c
	xkb/ddxBeep.c
	xkb/ddxCtrls.c
	xkb/ddxKeyClick.c
	xkb/ddxList.c
	xkb/ddxLoad.c
	xkb/xkb.c
	xkb/xkbAccessX.c
	xkb/xkbEvents.c
	xkb/xkbInit.c
	xkb/xkbPrKeyEv.c
	xkb/xkbUtils.c
2008-03-04 18:11:10 +10:30
Eamon Walsh
27bcf40cda XACE: Fix instances of DixUnknownAccess at hook callsites. 2008-02-28 16:43:43 -05:00
Peter Hutterer
453661a9e1 Xi: swap the control attached to a ChangeDeviceControl request. Bug #14170
Just swapping the request's data isn't enough, we need to swap the actual
control as well.

X.Org Bug 14170 <http://bugs.freedesktop.org/show_bug.cgi?id=14170>
2008-02-28 15:47:26 +10:30
Peter Hutterer
ce9fb2f8c4 Xi: MDs return the paired device's ID in attached field of ListInputDevices. 2008-02-26 13:51:19 +10:30
Peter Hutterer
d61f481a44 Xi: remove GetPairedPointer handling.
obsolete, ListInputDevices provides this information now.
2008-02-25 17:52:45 +10:30
Peter Hutterer
27b2127893 Xi: remove ungrab handling of ExtendedUngrabDevice request.
This can be done by UngrabDevice, no need for separate codepaths.
2008-02-25 17:00:42 +10:30
Peter Hutterer
09a8fc5c7a Xi: make SizeDeviceInfo public and re-use from CreateClassesChangedEvent. 2008-02-18 18:42:46 +10:30
Peter Hutterer
088067c891 Xi: even if ChangeDeviceHierarchy fails, we may need to send an event.
Changes are committed instantly, so if at least one change was successful, we
must send an event to the client, even if subsequent ones fail.
2008-02-18 16:46:07 +10:30
Eamon Walsh
ae43d835bd XACE: Change access modes for some device-related requests.
Opening a device is not really "reading" it.
Requests that globally configure a device should require "manage" access.
2008-02-13 20:20:49 -05:00
Peter Hutterer
921c298c4c Xi: QueryDevicePointer doesn't have a shared field anymore. 2008-02-14 09:48:19 +10:30
Peter Hutterer
b885588756 Xi: remove FakeDeviceData calls. And one leftover from GrabAccessControl.
FakeDeviceData needs more thoughtful integration.
2008-02-14 09:47:31 +10:30
Peter Hutterer
c99a9a9729 Xi: remove raw device events.
Need to be better refined.
2008-02-14 09:43:49 +10:30
Peter Hutterer
b35a9efa16 Xi: Remove files for GrabAccessControl. 2008-02-14 09:42:37 +10:30
Peter Hutterer
9d5edebe96 Xi: finish XKB initialisation before copying the keymap. 2008-02-07 21:24:45 +10:30
Peter Hutterer
0ac1755977 Merge branch 'master' into mpx
Conflicts:

	Xext/sampleEVI.c
2008-01-26 13:55:07 +10:30
Peter Hutterer
466f655219 Xi: if deviceid is > 127 assume GE mask is for all devices (XiSelectEvent). 2008-01-25 10:27:30 +10:30
Peter Hutterer
91dc8c43d2 Xi: Change window access right check to RecieveAccess in XiSelectEvent. 2008-01-25 10:27:21 +10:30
Peter Hutterer
94a6a65ae7 Xext: allow per-device GE masks.
Instead of a single mask per client we allow the storage of a mask per client
per device.
2008-01-25 10:26:41 +10:30
Peter Hutterer
ba315ae5dd Xi: add XACE hooks for device creation (ChangeDeviceHierarchy)
AddInputDevice checks for permissions already, so all we do is modify a few
callers to let AID sort it out.
2008-01-21 23:44:07 +10:30
Peter Hutterer
6e17184486 Xi: Check for DestroyAccess when trying to delete a master device. 2008-01-18 17:52:38 +10:30
Matthieu Herrb
dd5e0f5cd5 Fix for CVE-2007-6427 - Xinput extension memory corruption. 2008-01-17 15:27:34 +01:00
Peter Hutterer
4fd0885978 Xi: remove some leftovers from ProcessOtherEvents.
Core handling not needed anymore here.
2008-01-15 18:58:42 +10:30
Peter Hutterer
32aa252e98 dix: Process an input event as a single event, instead of two separate ones.
This is a significant shift in how input events are perceived. The common
approach was to treat a core event as a different entity than the XI event.
This could result in the XI event being delivered to a different client than
the core event. This doesn't work nicely if they come from the same device.

Instead, we treat an input event as a single event, that is delivered through
two separate APIs. So when delivering an event, we first try the XI event,
then the core event. If the window want's neither, we go to the parent and
repeat. Once either core or XI has been delivered, the processing stops.

Important: Different to the previous method, if a client registers for core
button events, the parent window will not get XI events. This should only
cause problems when you're mixing core and XI events, so don't do that!

Generic events don't fit into this yet, they cause me headaches.
2008-01-15 18:41:51 +10:30
Peter Hutterer
0969a9f749 dix: Emulate core events within CheckDeviceGrabs and ComputeFreezes.
This should restore the correct passive grab processing. When checking for
passive grabs, the core event is emulated and we check first for XI grabs on
the window, then for core grabs. Regardless of which event activates the grab,
the XI event is stored in the device's EQ.

When replaying the event, we take the XI event and replay it on the next
window, again including the emulation of the core event.
2008-01-15 11:31:12 +10:30
Peter Hutterer
4e85c7c322 Xi: keep a counter of buttons down to avoid duplicate press/release events.
If two devices are attached to the same master device, pressing button 1 on
each of them leads to two button presses from the same device. Some apps
really don't like that.

So we just put a counter in place and only send the first press and the last
release.
2008-01-09 17:36:39 +10:30
Peter Hutterer
249b9b30c1 Xi: remove file for the obsolete ChangePointerKeyboardPairing request handling. 2008-01-04 13:49:48 +10:30
Peter Hutterer
9cc41b88df Xi: ProcXSetClientPointer should directly check for the client from the id.
The window ID includes the client ID anyway, so we might as well just look up
the client directly instead of trying to get the window first and the client
from the window.

This also fixes a possible issue with XACE. If the client had permission to
write on the client but not on the window, the previous approach would have
failed.
2008-01-03 18:48:13 +10:30
Peter Hutterer
37194b1355 Xi: switch to using "rc" (instead of "err") as returncode.
All the rest of XI uses rc and returns rc in case of error, so make
mpx-related stuff comply. This stops the rest of XI sending the error
manually.
This is just a cosmetic change to be in line with the rest.
2008-01-03 18:36:33 +10:30