Commit Graph

400 Commits

Author SHA1 Message Date
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
ec1d08442f dix: Enable core devices in InitCoreDevices already.
Updated patch, see
http://lists.freedesktop.org/archives/xorg/2008-November/040540.html

Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2008-11-26 10:53:23 +10:00
Peter Hutterer
2b45602e82 Revert "dix: Enable core devices in InitCoreDevices already."
I merged the wrong patch. See correct patch at:
http://lists.freedesktop.org/archives/xorg/2008-November/040540.html

Not activating the device before attempting to enable it would leave the
sprite unset, crashing the server when enabling the real devices.

This reverts commit e078901a4e.

Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
2008-11-26 10:53:23 +10:00
Peter Hutterer
b292a7a2d7 dix: updated enter/leave core event model.
As proposed by Owen Taylor [1], the enter-leave event model needs to adjust
the events sent to each window depending on the presence of pointers in a
window, or in a subwindow.

The new model can be summarised as:
- if the pointer moves into or out of a window that has a pointer in a child
  window, the events are modified to appear as if the pointer was moved out of
  or into this child window.
- if the pointer moves into or out of a window that has a pointer in a parent
  window, the events are modified to appear as if the pointer was moved out of
  or into this parent window.

Note that this model requires CoreEnterLeaveEvent and DeviceEnterLeaveEvent to
be split and treated separately.

[1] http://lists.freedesktop.org/archives/xorg/2008-August/037606.html

Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
2008-11-25 09:21:46 +10:00
Peter Hutterer
e078901a4e dix: Enable core devices in InitCoreDevices already.
Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2008-11-24 10:17:40 +10:00
Peter Hutterer
d939f2482e dix: fix false comment.
VCP and VCK are always present, this comment is a leftover from earlier MPX
days.

Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
2008-11-24 10:07:22 +10:00
Simon Thum
7f818776b7 dix: fix typos in comments, one formatting fix.
Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
2008-11-21 09:04:17 +10:00
Peter Hutterer
971aef6441 dix: FreeDeviceClass() and friends can be static. 2008-10-31 18:26:18 +10:30
Peter Hutterer
7c5dec9f71 dix: remove unused GuessFreePointerDevice().
Not used since the MD/SD hierarchy was introduced many moons ago.
2008-10-31 18:26:18 +10:30
Peter Hutterer
12599af285 dix: NextFreePointerDevice() can be static. 2008-10-31 18:26:18 +10:30
Peter Hutterer
eb014021c2 dix: PairDevices() can be static, remove from input.
PairDevices() is only ever called in EnableDevice().
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
Peter Hutterer
4c926dbac6 dix: fix two more endian issues, correct initial "enabled" value. #18111
EnableDevice and DisableDevice both change the property too.

And enabled must be set to FALSE in AddInputDevice, the device is not enabled
yet.

X.Org Bug 18111 <https://bugs.freedesktop.org/show_bug.cgi?id=18111>
2008-10-23 14:17:04 +02:00
Peter Hutterer
ff60e592f0 dix: don't allow VCP/VCK be disabled through properties. 2008-10-23 17:42:47 +10:30
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
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
decec14219 dix: silence "unused variable" compiler warning. 2008-10-10 16:57:32 +10:30
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
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
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
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
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
998375f415 dix: remove superfluous check. 2008-08-12 20:42:08 +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
4e32e6fb38 dix: rename classic accel _scheme_ to lightweight to avoid confusion with
classic accel _profile_

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2008-07-28 18:13:18 +09:30
Keith Packard
67d7821ae7 dix: reset potential lastSlaves when disabling an SD
Unplug a mouse, then warp the pointer and the warp pointer code will try
to update the position of the last slave device associated with the
master. That pointer will be stale and the X server will crash.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2008-07-22 15:54:48 +09:30
Peter Hutterer
69de40ee45 dix: shift the duplicate button mapping check to ProcSetPointerMapping.
XI 2 allows two buttons to have the same button code.
2008-07-21 17:26:33 +09:30
Peter Hutterer
5bcc45e07e Xi: expose Enable/DisableDevice through XI_PROP_ENABLED property. 2008-07-13 20:54:33 +09:30
Simon Thum
c9eb0e870c Add support for multiple pointer acceleration schemes. #8583
Available acceleration schemes:
 - xorg classic scheme.
 - the new "Predictable" polynomial accel scheme.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
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
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
Eamon Walsh
02a8b118cd Fix "warning: implicit declaration of function ‘miPointerGetScreen’". 2008-06-13 21:01:50 -04:00
Peter Hutterer
fbf4b5f16a dix: set dst->mapWidth when allocating a new map. 2008-06-05 08:53:34 +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
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
1883485edd If core motion history is required, scale back to screen coords and INT16. 2008-05-26 17:22:25 +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
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
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
7a550cefd9 dix: shut up two compiler warnings. 2008-05-20 11:07:39 +09:30
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
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
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
53dba5381f dix: if alloc of a master keyboard fails, remove the master pointer. 2008-04-28 11:37:52 +09:30
Peter Hutterer
d9c38e84cc dix: remove pairingClient definition.
This variable was used originally to determine which client is allowed to
change the pointer-keyboard pairing. For now, we just let anyone change it and
see how that works out.
2008-04-25 14:29:26 +09:30
Peter Hutterer
8190ef8754 Merge branch 'master' into mpx
Conflicts:

	Xext/EVI.c
	Xext/appgroup.c
	Xext/cup.c
	Xext/mitmisc.c
	Xext/sampleEVI.c
	dix/window.c
2008-04-22 18:04:05 +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
48d33ab9b6 dix: float attached devices _before_ disabling the master.
It also helps if we're actually providing the correct argument to
AttachDevice...
2008-04-15 14:29:53 +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
6d22a9615a dix: Call DeleteInputDeviceRequest from CloseDownDevices (#14418)
The DDX (xfree86 anyway) maintains its own device list in addition to the one
in the DIX. CloseDevice will only remove it from the DIX, not the DDX. If the
server then restarts (last client disconnects), the DDX devices are still
there, will be re-initialised, then the hal devices come in and are added too.
This repeats until we run out of device ids.

This also requires us to strdup() the default pointer/keyboard in
checkCoreInputDevices.

X.Org Bug 14418 <http://bugs.freedesktop.org/show_bug.cgi?id=14418>
2008-04-11 18:45:32 +09:30
Peter Hutterer
b4380d8030 dix: don't free MDs classes on init.
The device classes aren't deleted anymore on a class change, so there's no
need to store the MD's original classes. We should however restore the MD to
sane defaults when disconnecting the last device, consider this as TODO item.
2008-04-10 19:25:43 +09:30
Peter Hutterer
04dff74ffd dix: Rework Enter/Leave semaphore system.
Instead of a simple counter, use bits to keep track of which device is where
etc. When device enters a window (or sets focus), the bit matching the device
is set, when it leaves again, it is unset. If there are 0 bits set, then
Leave/Enter/Focus events may be sent to the client.

Same theory as before, but this should get around the insanity with
Grab/Ungrab special cases. Those cases are basically untested though.
2008-04-10 19:22:59 +09:30
Peter Hutterer
8e0a652930 dix: When floating, set sprite to NULL before calling InitializeSprite.
InitializeSprite won't create a new one if it already exists, with the result
of overwriting the master's sprite. This master sprite is then assigned to the
floating slave, and freed when the slave is reattached later.
Setting the sprite to NULL forces InitializeSprite to alloc a new one, and
this one can be freed without further repercussions.
2008-04-10 08:25:36 +09:30
Peter Hutterer
b46a009186 dix: sprite may be NULL, don't dereference it then.
In some rare cases (e.g. when the init fails) a device's sprite is NULL,
dereferencing it to xfree the spriteTrace is a bad idea then.
2008-04-06 09:02:57 +09: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
Peter Hutterer
2257e20900 dix: set dev->key to NULL after freeing it in CloseDevice. (Bug #12830)
Otherwise XkbRemoveResourceClient may try to dereference it lateron.

X.Org Bug 12830 <http://bugs.freedesktop.org/show_bug.cgi?id=12830>
2008-02-27 17:32:29 +10:30
Peter Hutterer
23ae68a4c7 dix: before copying the classes the first time, set the VCK's classes to NULL.
XkbFinishDeviceInit does the following:
  xkbi->kbdProc= pXDev->kbdfeed->CtrlProc;
  pXDev->kbdfeed->CtrlProc= XkbDDXKeybdCtrlProc;

If we directly copy the device classes for the VCK, pXDev->kbdfeed->CtrlProc
at the time of copying is still XbkDDXKeybdCtrlProc. So at some point
XkbDDXKeybdCtrlProc is called, and calls itself, and calls itself, and...

Setting the device's classes to NULL seems to fix things. The memory isn't
lost, it gets stored into the devPrivates and freed at device closing time.
2008-02-26 15:35:28 +10:30
Peter Hutterer
750d702676 dix: Ensure enough memory for ClassesChangedEvent for a new device.
Before we enable the device through the driver, we size it up and make sure
that the events in the event list contain enough bytes for a possible
ClassesChangedEvent lateron.
2008-02-19 17:23:51 +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
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
38bf01bd1c Merge branch 'master' into mpx 2008-01-10 13:38:46 +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
e4a214e40d dix: don't free device's devPrivates manually, dixFreePrivates does it.
Merge detritus from last pull.
2008-01-04 13:32:53 +10:30
Peter Hutterer
b2da44c76d dix: DoChangeKeyboardControl shouldn't be using inputInfo.keyboard. 2008-01-03 18:51:44 +10:30
Peter Hutterer
c7e9b67c54 dix: free ClassesRec when a BadAlloc occurs during CoreKeyboardProc. 2008-01-03 18:09:56 +10:30
Peter Hutterer
8da83836b6 Merge branch 'master' into mpx
Conflicts:

	XTrap/xtrapddmi.c
	Xext/security.c
	Xext/xprint.c
	Xext/xtest.c
	Xext/xvdisp.c
	Xi/exevents.c
	Xi/grabdevb.c
	Xi/grabdevk.c
	Xi/opendev.c
	Xi/ungrdev.c
	Xi/ungrdevb.c
	Xi/ungrdevk.c
	dix/cursor.c
	dix/devices.c
	dix/dixutils.c
	dix/events.c
	dix/getevents.c
	dix/main.c
	dix/window.c
	hw/xfree86/ramdac/xf86Cursor.c
	include/dix.h
	include/input.h
	include/inputstr.h
	mi/midispcur.c
	mi/miinitext.c
	mi/misprite.c
	render/animcur.c
	xfixes/cursor.c
	xkb/xkbAccessX.c
2008-01-03 17:04:54 +10:30
Daniel Stone
24105cf658 Input: Don't reinit devices
If a device is already initialised (i.e. the virtual core devices) during
IASD, don't init them again.  This fixes a leak.
2007-12-28 15:51:36 +02:00
Peter Hutterer
004876355b dix: Remove RegisterPairingClient and UnregisterPairingClient. 2007-12-03 14:32:23 +10:30
Peter Hutterer
6216abe0c1 dix: avoid activating the VCP/VCK twice.
This may set dev->key-xkbinfo to NULL, causing a segfault in xkb code lateron.
Spotted by David Huggins-Daines.
2007-11-30 11:34:24 +10:30
Peter Hutterer
f9269bebae DeviceIntRec: move lastx/lasty from valuator into DeviceIntRec.
We free the ValuatorClassRec quite regularly. If a SIGIO is handled while
we're swapping device classes, we can bring the server down when we try to
access lastx/lasty of the master device.
2007-11-22 17:30:14 +10:30
Peter Hutterer
12dd6e9911 dix: reset MD's devPrivate classes to NULL before device initialisation.
XkbInitKeyboardDefviceStruct may call FatalError if it fails. FatalError then
cleans up all the devices, resulting in a segfault if the pointer is
uninitialised.
2007-11-16 17:23:09 +10:30
Peter Hutterer
be3321c2e9 dix: Free both current classes and original classes when closing an MD. 2007-11-16 12:12:41 +10:30
Peter Hutterer
497862df2f dix: explicitly float all attached SDs before closing down devices.
Some drivers flush on shutdown, if our SD is still attached we'd be trying to
route an event through a non-existing device.
2007-11-16 11:20:22 +10:30
Peter Hutterer
9de1ebe2a8 dix: Fix up class restoring when last SD disconnects.
Old code was fundamentally broken, fixes now are:
- free the MDs current device classes
- copy the device classes instead of flipping the pointers
- check for the old MD, not the new one.
2007-11-16 10:45:28 +10:30
Peter Hutterer
53539688ca dix: SetKeySymMap should alloc the map if dst doesn't have one already. 2007-11-15 16:23:48 +10:30
Peter Hutterer
b40646dc10 dix: Add FreeDeviceClass and FreeFeedbackClass for centralised xfree.
Ensures that we only have one way of freeing a device class to avoid leaks in
ChangeMasterDeviceClasses and other places.
2007-11-15 15:43:44 +10:30
Peter Hutterer
c758e5a664 dix: Make sure core MDs copy their initial classes before they are used.
Anything in dev->key, dev->valuator etc. of a MD must always be a copy of the
original class. The intial classes of an MD (the ones set up before an SD is
attached) as well, as we may have to restore them if no SD is attached
anymore.
2007-11-15 10:47:20 +10:30
Eamon Walsh
1603130236 Merge branch 'master' into XACE-SELINUX
Conflicts:

	Xext/xace.c
	Xext/xace.h
2007-11-14 13:35:50 -05:00
Peter Hutterer
b44c1118f3 dix: Return Success from ProcBell if no BellProc is set.
We must not return BadDevice, this causes applications to crash. If no
BellProc is set, just quietly do nothing and report a Success.
2007-11-14 14:08:21 +10:30
Peter Hutterer
5031238aad dix: remove trailing/wrong whitespaces from devices.c and events.c 2007-11-13 16:58:23 +10:30
Peter Hutterer
c703849e79 dix: Attach spriteInfoRec to same memory block as the DeviceIntRec.
No need to alloc a separate one, we never do anything special with it anyway.
2007-11-13 16:50:18 +10:30
Peter Hutterer
a05f43bf3e dix: When the last slave is removed, set master to the original classes.
DeviceClassesChangedEvent is sent to the client, where device == new slave.
2007-11-12 11:35:18 +10:30
Peter Hutterer
7a81bafc9b Xi, dix: Add ability to change MD classes + send event when doing so.
Each time a different slave device sends through a master, an
DeviceClassesChangedEvent is enqueued. When this event is processed, all
classes of the matching master device are changed, and the event is sent to
the clients.

Next time the master is queried, it thus shows the evclasses of the last slave
device. The original classes are stored in the devPrivates.

TODO: if all slave devices are removed, the master's original classes need to
be restored.
2007-11-09 23:10:24 +10:30
Peter Hutterer
59b304d8a2 dix, mi: stop segfaults when a floating device emits events.
For pointers: don't try to set master->valuator fields if there is no master.
For keyboards: check if device is valid before trying to access the fields in
miPointerGetScreen (btw. this disables DGA events for floating keyboards).

Also stop the hideous number of ErrorFs if we request the paired device for a
floating dev.
2007-11-08 15:44:18 +10:30
Peter Hutterer
184a7b8917 Merge branch 'mpx' into mdsd
Conflicts:

	Xi/opendev.c
2007-11-08 09:34:35 +10:30
Peter Hutterer
0b729051c0 Merge branch 'master' into mpx
Conflicts:

	Xi/extinit.c
	Xi/grabdev.c
	Xi/setmode.c
	Xi/ungrdev.c
	dix/devices.c
	dix/events.c
	dix/getevents.c
	include/dix.h
	mi/midispcur.c
	mi/misprite.c
	xkb/xkbActions.c
	xkb/xkbEvents.c
	xkb/xkbPrKeyEv.c
2007-11-07 15:37:23 +10:30
Daniel Stone
512bac25ec DIX: XKB: Set xkbInfo to NULL as well as freeing it (bug #10639)
XkbRemoveResourceClient wants to access xkbInfo if it exists, so make
sure we NULL it after freeing it.  It doesn't make much sense to move
the RemoveResourceClient call first, as there's not much point in
notifying clients while we're shutting the server down anyway.
2007-11-07 03:58:56 +02:00
Eamon Walsh
a52c9b2a59 Merge branch 'master' into XACE-SELINUX
Conflicts:

	dix/dispatch.c
	dix/property.c
	hw/xfree86/common/xf86VidMode.c
	include/xkbsrv.h
	render/glyph.c
	xkb/xkbActions.c
2007-11-05 19:08:36 -05:00
Daniel Stone
914922fd61 DIX: Remove usage of alloca
Replace with heap allocations.
2007-11-05 14:34:43 +00:00
Peter Hutterer
7ef863720d dix: Create new sprite for floating devices.
Floating devices get sprites, but still aren't spriteOwners. This prevents
them from getting rendered, and also stops segfaulting.
(not really solving the problems with keyboards though)
2007-10-23 17:28:03 +09:30
Peter Hutterer
5ba738935f Xi: remove ChangePointerKeyboardPairing in favour of ChangeDeviceHierarchy. 2007-10-19 14:36:37 +09:30
Peter Hutterer
1d9ebbac8c dix: Make InitCoreDevices use AllocMasterDevice.
Also change naming a bit, append "pointer" and "keyboard" to master devices
instead of -ptr and -keybd.
2007-10-16 18:46:12 +09:30
Peter Hutterer
299573f461 dix: add AllocMasterDevice for creation of new master devices.
Devices are initiated pretty much the same as the core devices.
2007-10-16 18:40:15 +09:30
Peter Hutterer
caa69d8f7b dix: fix detritus from adding lastSlave field. 2007-10-16 17:38:13 +09:30
Peter Hutterer
e6bd8ae060 dix: set the device's sprite when using AttachDevice
Sprite is set to the master device's sprite.
2007-10-16 15:59:30 +09:30
Peter Hutterer
840bde3d32 dix: GetPairedDevice: return dev paired with master for slave devices. 2007-10-16 13:09:35 +09:30
Peter Hutterer
9ccc9ab6f2 dix: don't call CloseDevice on VCP/VCK separately. 2007-10-16 12:04:48 +09:30
Peter Hutterer
e4fd981b48 dix: check for isMaster before calling DeviceCursorCleanup. 2007-10-16 12:04:40 +09:30
Peter Hutterer
7503d13407 dix: don't check VCK and VCP separately when looking for device ids.
Both are part of the device list again, so we cover them there.
2007-10-16 12:04:30 +09:30
Peter Hutterer
032e906711 dix: Remove GetPairedPointer, GetPairedKeyboard in favour of GetPairedDevice. 2007-10-16 11:57:42 +09:30
Peter Hutterer
3e07e73fef dix: remove pairing/attachment from InitAndStartDevices.
If we enabled in the correct order, this has all been done already.
2007-10-16 11:34:29 +09:30
Peter Hutterer
38baac71bd dix: Set bidirectional pairing, don't allow pairing with already paired devs. 2007-10-16 11:30:59 +09:30
Peter Hutterer
70efd3d06a dix: fix up Activate/Enable/Disable device.
Set isMaster for VCP/VCK.
Init sprites for master pointer devices.
Pair master kbds with master pointers (1:1 pairing!).
Attach other devices to VCP/VCK.
2007-10-16 11:30:32 +09:30
Peter Hutterer
bd7d5255ce dix: add AttachDevice, needed to attach a slave device to a master device.
For now, we don't allow attaching slaves to other slaves, and we don't allow
pairing slaves with other slaves.
Pairing is for master keyboard->master pointer only.
Attaching is for slave device->master device only.
2007-10-16 11:18:31 +09:30
Peter Hutterer
be1565f6b8 dix: Set core devices to ProcessOtherEvents, set sendCore and XKB.
Even the virtual core devices should send through ProcessOtherEvents.
2007-10-16 11:05:34 +09:30
Peter Hutterer
042e16458b dix: change a few inputInfo.keyboard over to PickKeyboard() 2007-10-09 23:07:51 +09:30
Peter Hutterer
d42909b23a dix: when disabling a device, make sure all paired devices are re-paired.
We re-pair them with the VCP, not a real device! If we would do otherwise,
somebody may change our keyboard focus and thus get us typing where we don't
want to type.
2007-10-05 13:04:10 +09:30
Peter Hutterer
ff2351246d dix: When pairing, only check for access right if client is set.
If the pairing client is not set, then the pairing is initiated internally
(e.g. when a new keyboard device is configured). In this case we _must_ pair
regardless of who is the pairing client.
2007-10-05 12:19:40 +09:30
Eamon Walsh
59cebcd2e9 xace: add creation hook for new input devices.
Unfortunately, more information is needed to properly label the device.
This will come from the configuration file, the hotplug messages, etc.
It will either have to be passed into this function,
or this hook moved down into the callers.
2007-10-02 13:45:18 -04:00
Eamon Walsh
8b54865720 xace: add hooks + new access codes: XKB extension.
Removes "LookupKeyboardDevice" and "LookupPointerDevice" in favor of
inputInfo.keyboard and inputInfo.pointer, respectively; all use cases
are non-XI compliant anyway.
2007-09-28 13:34:18 -04:00
Eamon Walsh
5c03d13181 xace: add new hooks + access controls: XInput extension.
Introduces new dix API to lookup a device, dixLookupDevice(), which
replaces LookupDeviceIntRec and LookupDevice.
2007-09-28 08:02:00 -04:00
Peter Hutterer
be466d8df8 dix: GetPairedKeyboard() always returns a valid keyboard (VCK if necessary).
We need it unconditionally in a few places, and the rest checked for NULL and
then set it to VCK anyway. So, fixing up all callers to appreciate the defined
return value.
2007-09-28 09:28:39 +09:30
Eamon Walsh
27612748e0 Merge branch 'master' into XACE-SELINUX
Conflicts:

	dix/devices.c
2007-09-26 07:47:29 -04:00
Peter Hutterer
8b508f5d6b dix: unify ErrorFs. prepend all with [dix]. 2007-09-26 15:19:53 +09:30
Daniel Stone
27ad5d74c2 Input: Generate XKB mapping changes for all core-sending devices (bug #12523)
When we change the mapping on a core device, make sure we propagate this
through to XKB for all extended devices as well.
2007-09-23 17:17:20 +03:00
Eamon Walsh
97c150b61b Merge branch 'master' into XACE-SELINUX
Conflicts:

	afb/afbpntwin.c
	afb/afbscrinit.c
	afb/afbwindow.c
	cfb/cfb.h
	cfb/cfballpriv.c
	cfb/cfbscrinit.c
	cfb/cfbwindow.c
	configure.ac
	fb/wfbrename.h
	hw/xfree86/xf4bpp/ppcIO.c
	hw/xfree86/xf4bpp/ppcPntWin.c
	hw/xfree86/xf4bpp/ppcWindow.c
	hw/xfree86/xf8_32bpp/cfbscrinit.c
	mfb/mfb.h
	mfb/mfbpntwin.c
	mfb/mfbscrinit.c
	mfb/mfbwindow.c
	mi/miexpose.c

Note: conflicts caused by devPrivates rework vs. paintwindow changes.
2007-09-19 07:25:55 -04:00
Peter Hutterer
72b347e681 dix: Enabling devices must not overwrite existing sprites/pairing.
EnableDevices is (amongst others )called after a VT switch. We must not create
a new sprite or re-pair the device, otherwise we lose the input device setup
that we had before the VT switch.

This requires the devices to be in exactly the same order as before
the VT switch. Removing a device while on a different VT is probably a bad
idea.
2007-09-07 14:31:19 +09:30
Peter Hutterer
49dbe9a757 dix: close virtual core devices after other devices.
If a device is paired with the VCP, deleting the VCP before the device will
segfault the server when the sprite should get updated.
2007-09-06 17:27:28 +09:30
Peter Hutterer
03680a384a dix: don't change the device struct while processing core events.
The device state needs to be changed while processing the XI event. Core
events are always processed after XI, so by then the device is already set up
properly. However, we now rely on DeviceButtonMotionMask to be equal to
ButtonMotionMask. It already is, but stick a big fat warning in so nobody
attempts to change it.

This commit disables XKB for the VCK, thus essentially for all devices.
Temporarily anyway.
2007-09-06 15:43:47 +09:30
Daniel Stone
81c28ffd2b Fix key repeats during VT switch.
Add keyc->postdown, which represents the key state as of the last mieqEnqueue
call, and use it when we need to know the posted state, instead of the
processed state (keyc->down).  Add small functions to getevents.c to query and
modify key state in postdown and use them all through, eliminating previously
broken uses.
2007-09-05 17:46:23 -07:00
Eamon Walsh
41355a53c2 xace: add hooks + new access codes: core protocol input requests 2007-08-28 15:10:20 -04:00
Eamon Walsh
4017d31902 devPrivates rework: since API is already broken, switch everything
over to new system.

Need to update documentation and address some remaining vestiges of
old system such as CursorRec structure, fb "offman" structure, and
FontRec privates.
2007-08-28 09:28:25 -04:00
Peter Hutterer
f367285fd5 Merge branch 'master' into mpx
Conflicts:

	Xi/exevents.c
	dix/devices.c
	dix/getevents.c
	include/dix.h
	mi/mieq.c
2007-08-12 15:31:10 +09:30
Eamon Walsh
e34fcd2bf4 Merge branch 'master' into XACE-SELINUX
Conflicts:

	dix/devices.c
	dix/property.c
	include/dix.h
2007-08-02 14:27:03 -04:00
Daniel Stone
8658f5d923 Hotplug: Add HAL support
Add support for HAL-based hotplugging, in which we just get the list of
input devices and properties from HAL.  Requires an FDI which is not yet
in mainline HAL.
2007-08-01 01:53:31 +03:00
Peter Hutterer
24ee89fd60 Add a few comments to devices.c 2007-06-25 09:35:30 +09:30
Peter Hutterer
1f97a76476 Merge branch 'master' into mpx
Conflicts:

	dix/devices.c
	hw/xfree86/common/xf86Xinput.c
	hw/xfree86/loader/xf86sym.c
	mi/mieq.c
2007-06-19 17:20:52 +09:30
Peter Hutterer
9e257029c7 Add implicitGrab field to GrabInfoRec.
Is set when passive grab is implicit as result of a ButtonPress event. If this
is the case, we need to store the XI mask as well as the core mask to ensure
delivery of XI events during the grab's lifetime.

Remove all core grabs on other devices when client issues a GrabPointer or
GrabKeyboard request. Let's assume that the client really only wants one
device to interact, so this seems like a reasonable solution.
2007-06-19 11:28:07 +09:30
Eamon Walsh
e2a720c9a1 Merge branch 'master' into XACE-SELINUX
Conflicts:

	dix/dixutils.c
2007-06-11 15:29:11 -04:00
Zephaniah E. Hull
a4f3473c88 Fully init the AbsoluteClassRec in InitAbsoluteClassDeviceStruct.
(Specificly, we were missing the screen field.)
2007-06-04 06:39:02 -04:00
Luo Jie
3c982bc1a4 Reinstate an apparently mis-deleted ';' from a for loop with no body.
Fixes an error returning "No core keyboard" with multiple keyboards.
2007-05-24 11:30:31 -07:00
Eamon Walsh
2a4aa63a23 Merge branch 'master' into XACE-SELINUX
Conflicts:

	include/miscstruct.h
2007-05-22 14:50:26 -04:00
Peter Hutterer
bc334286b0 Init device axis with -1,-1 minimum values.
This is needed to be able to cross to screens located east/north of the
current active screen.
2007-05-17 10:36:46 +09:30
Peter Hutterer
5c680e9493 Remove double-grab option. We only want one grab per device. 2007-05-14 12:34:53 +09:30
Peter Hutterer
4dc973f08c Add ExtendedGrabDevice handling.
Add XGE handling in DeliverGrabbedEvent.

We can now grab something selecting XGE events, but the current code is a
bit messy and doesn't work too well yet.
2007-05-14 10:42:03 +09:30
Peter Hutterer
0214d0b96a Start devices after windows are initialized.
This fixes the hotplug segfault introduced with the multihead changes and
cleans up the code a bit as well.
2007-05-01 15:49:41 +09:30
Peter Hutterer
325380adb2 Check and re-set paired devices when initializing sprites.
If we don't do this, a device that is paired before a sprite has been
initialized for the paired device will not actually get the right sprite and
segfault the server on focus events. Happens for the VCK.
2007-05-01 11:02:05 +09:30
Peter Hutterer
b043a18450 Check VCP's and VCK's ids when searching for a new device id.
Both VCP and VCK are not in the inputInfo.devices list anymore, so we need to
check them separately. If we don't do this, we end up re-using ids 0 and 1,
causing all sorts of grief for clients.
2007-05-01 09:54:33 +09:30
Peter Hutterer
f28eea0647 Merge branch 'master' into mpx
Conflicts:

	dix/devices.c
	dix/events.c
2007-04-27 16:34:36 +09:30
Paulo Ricardo Zanoni
82f97e1c0c Enable event delivery for multiple heads.
Requires moving the spriteTrace into the DeviceIntRec and adjusting a few
functions to take in device argument, most notably XYToWindow().

Cursor rendering on the second screen is busted.
2007-04-26 15:58:50 +09:30
Peter Hutterer
09436fb7c3 Disable devices before removing, remove unrecoverable devices. 2007-04-24 23:11:44 +09:30
Peter Hutterer
c7e2ba0c9b Use DevicePresence events to tell the client about enabled/disabled devices.
Include the device id in the event sent to the client.
2007-04-24 23:11:44 +09:30
Brian
ce099a9b78 fix bug in which maxKeysPerModifier wasn't getting set 2007-04-23 12:34:01 -06:00
Peter Hutterer
d61ed6c8a2 Check for NULL devices in CloseDevice(). 2007-04-19 18:08:55 +09:30
Eamon Walsh
9cee4ec5e6 xace: change the semantics of the return value of XACE hooks to allow
arbitrary X status codes instead of just TRUE/FALSE.

The dix layer in most cases still does not propagate the return value of
XACE hooks back to the client, however.  There is more error propagation
work to do.
2007-04-17 16:01:56 -04:00
Eamon Walsh
1f06d32ef5 Merge branch 'master' into XACE-SELINUX
Conflicts:

	dix/privates.c
2007-04-17 12:10:22 -04:00
Peter Hutterer
d4dad6f84f Merge branch 'master' into mpx
Conflicts:

	configure.ac
	dix/events.c
	hw/xfree86/common/xf86Xinput.c
2007-04-12 11:11:03 +09:30
Magnus Vigerlöf
4f05f9591e Input: Always add devices with first available ID
Scan the device list when adding a new device, and make sure we can use
the first available ID, instead of always incrementing.
2007-04-10 23:58:20 +03:00
Magnus Vigerlöf
07c56abf84 Input: Plug memory leak in device free
Remember to also free the motion history, if we're using the DIX-managed
history.
2007-04-10 23:58:20 +03:00
Stefan Huehner
1f6741db19 Bug #10560: Code-Cleanup: function declarations () -> (void)
X.Org Bugzilla #10560: <https://bugs.freedesktop.org/show_bug.cgi?id=10560>
Patch #9511 <https://bugs.freedesktop.org/attachment.cgi?id=9511>
2007-04-09 14:33:15 -07:00
Peter Hutterer
f1f8b562aa Alloc sprite memory in devices' devPrivates, allow undisplaying cursors.
Improve memory usage by allocating the sprite's memory only to devices that
actually have a sprite and provide means to remove a device's cursor from the
screen (more hotplugging, yay!).
This commit breaks ScreenRec's ABI.
2007-04-09 19:31:59 +09:30
Peter Hutterer
7cef789fa1 Close down virtual core devices when closing all devices. 2007-04-09 18:37:48 +09:30
Peter Hutterer
6081b8c76f Don't explicitly init sprite for VCP, EnableDevice() will take care of that. 2007-04-09 18:35:47 +09:30
Peter Hutterer
00b1d52f41 Adding some comments to devices.c. 2007-04-09 18:32:00 +09:30
Peter Hutterer
aa77ffb510 Fix: pick new ClientPointer when device is closed. 2007-04-09 18:29:00 +09:30
Eamon Walsh
1d550bb2c5 devPrivates rework: minor fix; use calloc and avoid initialization. 2007-04-05 12:12:58 -04:00
Eamon Walsh
63e46e4fc3 devPrivates rework: properly free devPrivates on compatibility structures,
excluding pixmap.
2007-04-04 15:59:51 -04:00
Peter Hutterer
e8777a91f3 Merge branch 'master' into mpx
Conflicts:

	Xi/closedev.c
	Xi/exevents.c
	Xi/extinit.c
	Xi/listdev.c
	dix/window.c
	hw/xfree86/common/xf86Xinput.c
	include/extinit.h
	mi/mipointer.c
2007-04-02 15:36:26 +09:30
Eamon Walsh
0331c6a8fc Merge branch 'master' into XACE-SELINUX 2007-03-26 10:28:05 -04:00
Adam Jackson
9a0f25de7c Static cleanups, dead code deletion. 2007-03-25 12:27:01 -04:00
Peter Hutterer
ac2356843e dix: Increase allocation size for core keyboard keymap to avoid buffer overrun when copying keymap from extension devices. 2007-03-25 15:24:47 +09:30
Peter Hutterer
5f9c10e8da Clean up DeviceIntPtr, prepare for Server 1.4 ABI. Move sprite-related
information into a new SpriteInfoRec, remove isMPDev flag.
2007-03-25 15:00:03 +09:30
Peter Hutterer
e54311395e dix: Increase allocation size for core keyboard keymap to avoid buffer
overrun when copying keymap from extension devices.
2007-03-25 09:41:33 +09:30
Adam Jackson
021fc5cb2c Static markup and dead code cull over xkb/.
The former <X11/extensions/XKBsrv.h> has been pulled into the server now as
include/xkbsrv.h, and the world updated to look for it in the new place,
since it made no sense to define server API in an extension header.  Any
further work along this line will need to do similar things with XKBgeom.h
and friends.
2007-03-20 18:37:02 -04:00
Peter Hutterer
0acf993e28 dix: Move sprite initalization/pairing from ActivateDevice to
EnableDevice.
        zero out spriteTrace, otherwise GetCurrentRootWindow() may return
        invalid data.

        Evdev adds previously hotplugged devices on its own when rescanning,
        and ActivateDevice does not get called for those devices. Sprites need
        to be initialized or paired before the device gets started, so the
        safest place to do so is EnableDevice (which actually does get called
        by the evdev driver).
2007-03-19 16:11:01 +10:30
Peter Hutterer
015d728bcd Merge branch 'master' into mpx
Conflicts:

	dix/devices.c
	dix/events.c
	mi/misprite.c
2007-03-19 09:42:56 +10:30
Peter Hutterer
65b0eb60b0 Xi: move IsPointerDevice into dix.
dix:    IsPointerDevice and IsKeyboardDevice, use same ways to identify type
        of device as XI does for the XListInputDevices reply.
        Autopair each non-pointer device with VCP when activating, pair with
        real device after activation.
        Don't return non-keyboard devices when calling GetPairedKeyboard or
        PickKeyboard, otherwise we segfault for 'evdev brain'.
2007-03-16 15:52:24 +10:30
Peter Hutterer
456f429ad6 dix: fix: don't return when device is same as argument.
fix: set access default rule to 0 on init.
2007-03-15 21:48:19 +10:30
Peter Hutterer
ce9409aceb dix: Get the state from the paired device and the real device to fill the
state field in the event, rather than using the virtual devices.
        ProcessPointerEvent: name argument "device" instead of "other".
        Add GetPairedKeyboard().
2007-03-13 19:16:56 +10:30
Eamon Walsh
c45f676208 devPrivates rework: hook up new mechanism in backwards-compatibility mode
on existing structures that support devPrivates.
2007-03-08 12:12:51 -05:00
Peter Hutterer
63169ce52d dix: remove 'register' keyword for all variables. 2007-03-08 17:50:25 +10:30
Peter Hutterer
ceca5670fe dix: Each device needs to differ between a core grab and an XI grab,
otherwise a Xi grab may overwrite or release a core grab.
        Replace grab and associates with coreGrab and deviceGrab structures,
        adjust rest of dix/Xi/etc to compile.

xfree86: Don't check for core devices, we'll have the virtual ones anyway.
         If we check, the first mouse device is duplicated and sends
         double events.
2007-03-08 17:17:23 +10:30
Eamon Walsh
b5fde366e2 Properly free device devPrivates - memory leak fix. 2007-03-07 12:29:55 -05:00
Peter Hutterer
537bc2ead4 Xi: Don't deactivate core grabs from non-core button/key releases.
dix:    set coreGrab flag for grabs caused by GrabPointer and button presses.
        remove virtual core devices from device list, only real devices are in
        the list now.
        Auto-pair each keyboard with a real pointer if one is available,
          provides multiple keyboards automatically after startup if devices
          are configured.
        fix GuessFreePointerDevice() to do what it's supposed to do.

mi:     fix: call miPointerMove from miPointerWarpCursor.
        fix: remove unused id field from miCursorInfoRec
        don't update sprite for virtual core pointer.
2007-03-07 18:19:20 +10:30
Peter Hutterer
39aa791771 dix: Add GuessFreePointerDevice(). Runs through device list and tries to
find a pointer that hasn't been paired yet.

xfree86:  Use GuessFreePointerDevice() for newly connected non-sprite devices.
2007-03-05 15:31:16 +10:30
Peter Hutterer
57aa5e908d dix, Xext, Xtrap, Xi: replace inputInfo.pointer with PickPointer where
possible. More replacements to come.
2007-03-02 17:14:37 +10:30
Peter Hutterer
e43b8a4e40 dix: Add ClientPointer to client, used for picking which pointer to use in
ambiguious request. PickPointer and PickKeyboard are used for getting
        the appropriate pointer when situation is unclear.
        Fix some issues with InitializeSprite.

dix, xfree86: Remove last traces of InitSprite.
2007-03-02 15:21:46 +10:30
Peter Hutterer
43bd35fcf8 dix: Remove InitSprite, work can be done by InitializeSprite.
Free sprite struct if a spriteOwner is paired.

xfree86: Use PairDevices instead of passing booleans around when creating a
         sprite.

Xext:    Switch back to using LookupPointer/KeyboardDevice instead of
         inputInfo.xyz.
2007-03-01 17:19:37 +10:30
Peter Hutterer
cd0af7a785 Xi, dix: Only one client at a time can change the pointer-keyboard pairing,
using xRegisterPairingClient request.
2007-02-21 10:08:41 +10:30
Ben Byer
81444486be autoconf goodness for XDarwin, courtesy of pogma 2007-02-17 02:23:11 -08:00
Ben Byer
cf4994b0db dix mods for Darwin 2007-02-17 01:21:43 -08:00
Peter Hutterer
4aaaa70d1b Xi: Adding ChangePointerKeyboardPairing request
Adding PointerKeyboardPairingChanged event
	Correct error values for XWarpDevicePointer

dix:	Adding device argument to SendMappingNotify
	Adding spriteOwner flag to devices
2007-01-29 18:23:24 +10:30
Peter Hutterer
2d0a63126b Merge branch 'master' of git://anongit.freedesktop.org/git/xorg/xserver 2006-12-19 10:31:40 +10:30
Peter Hutterer
03c554283e mi: removing MPX ifdefs
global sprite renaming in mipointer and misprite
	fixed: multiple remove cursor call in miSpriteInstallColormap
	fixed: wrong core pointer usage in miSpriteStoreColors

dix:    bugfix in CheckCursorConfinement
	removing MPX ifdefs
	removing MPX event generation (using Xi solely now)
	bugfix GrabDevice: uninitialized field in grab struct caused segfault

xfree86: removing MPX fdefs

Xi:     removing MPX protocol events
2006-12-18 15:33:54 +10:30
Eamon Walsh
25d5e0a629 Convert callers of SecurityLookupWindow() to dixLookupWindow(). 2006-12-15 15:50:46 -05:00
Peter Hutterer
ae3c24da34 dix: Moving SpriteRec into DeviceIntRec
removing global sprite structure
	beginning to remove MPX ifdefs

xnest:  Fix to make xnest compile again
2006-12-11 18:09:59 +10:30
Eamon Walsh
f44f14fe56 Define calls away when not building XACE, allowing ifdef's to be removed. 2006-12-01 21:15:41 -05:00