Commit Graph

183 Commits

Author SHA1 Message Date
Peter Hutterer
ebe45e1a72 input: introduce partial class copying depending on the event.
Copying all classes into the master device has drawbacks for hybrid devices
(devices that are both mice and keyboards). If such a device posts an event,
it's key classes are moved into the VCP. The key event itself is unaffected
by keyboard grabs and the like.

Partial class copying copies depending on the event and copies the classes
into the right master device (i.e. the VCK for key events, the VCP for
pointer events).

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-05-22 15:44:57 +10:00
Peter Hutterer
bc63c8a457 dix: introduce GetMaster()
For hybrid devices (keys + buttons/axes) the attached master device is
generally the wrong one. One shouldn't post a button event through a
keyboard and vice versa.

GetMaster(dev) returns the right master device for the given type needed.
This may be the MD paired with this device's MD.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-05-22 15:44:57 +10:00
Peter Hutterer
d79318f269 dix: Add a deviceid to the DeviceChangedEvent.
ChangeDeviceId would actually overwrite the flags field if deviceid wasn't
present. Aside from the event of course not telling which device generated
it in the first place.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-05-22 15:44:57 +10:00
Peter Hutterer
b12d302df8 Input: rename DeviceIntRec->isMaster to ->type.
isMaster is not enough as long as we differ between master pointers and
keyboard. With flexible device classes, the usual checks for whether a
master device is a pointer (currently check for ->button, ->valuators or
->key) do not work as an SD may post an event through a master and mess this
check up.

Example, a device with valuators but no buttons would remove the button
class from the VCP and thus result in the
IsPointerDevice(inputInfo.pointer) == FALSE.

This will become worse in the future when new device classes are introduced
that aren't provided in the current system (e.g. a switch class).

This patch replaces isMaster with "type", one of SLAVE, MASTER_POINTER and
MASTER_KEYBOARD. All checks for dev->isMaster are replaced with an
IsMaster(dev).
2009-05-22 15:44:50 +10:00
Peter Hutterer
add2defac7 Split the signal-handler's lastSlave out into a separate variable.
dev->u.lastSlave was not signal safe since it was accessed by the DIX and
during signal handling.
Replaced with:
'dev->last.slave' for the signal handler's lastSlave (used to generate
                  DeviceChangedEvents), .
'dev->u.lastSlave' for the DIX lastSlave (currently only used in
                   change_modmap)

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-05-22 15:44:03 +10:00
Peter Hutterer
73c7398aaf dix: 'namespace' HAS_OLD_SLAVE and HAS_NEW_SLAVE.
We need more flags for this in the near future, so let's namespace them now.
2009-05-21 11:59:17 +10:00
Peter Hutterer
c2785ae7eb dix: refuse events from disabled devices.
If the device is disabled ("off"), it must not send events to a client.
The driver shouldn't send events in that case anyway, but just to make sure
we simply drop events coming while the device is disabled.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-05-20 16:22:24 +10:00
Peter Hutterer
00bc043fa0 dix: export subpixel precision in XI2 events for root/event coordinates.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-05-08 14:33:50 +10:00
Peter Hutterer
4318075140 dix: store subpixel precision and send it down the wire to the client.
For the valuator data, not yet for root x/y and event x/y.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-04-19 22:17:07 +10:00
Peter Hutterer
4cc6a96d71 input: add support for RawDeviceEvents. 2009-03-20 15:17:56 +10:00
Peter Hutterer
0befeb36c1 dix: Add device info to DeviceChangedEvent, and fill in CCCE.
We need to fill the info here, as the device may change until we get a chance
to process it.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-03-20 15:17:55 +10:00
Peter Hutterer
d60391d8ca dix: fix uncredible fail in PostSyntheticMotion.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-03-20 14:48:57 +10:00
Peter Hutterer
7f1ba804a1 dix: s/numEvents/num_events/ in GetKeyboardValuatorEvents
GPE and GProxE use the same.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-03-12 11:03:29 +10:00
Peter Hutterer
59bc615ed2 dix: set the valuator mode in set_valuators
We only have per-device mode for now anyway.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-02-25 14:50:55 +10:00
Peter Hutterer
d3b355875a dix: fix wrong condition for setting valuators on the event.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-02-24 11:20:23 +10:00
Peter Hutterer
bdc262701a dix: remove un-used getValuatorEvents and countValuatorEvents from getevents.c
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-02-23 17:52:40 +10:00
Peter Hutterer
085d503608 dix: Fix PostSyntheticMotion to use a DeviceEvent for posting.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-02-23 17:52:40 +10:00
Peter Hutterer
4026c63e4e mi: switch the EQ to contain InternalEvents only.
This gets rid of the nevents parameter, InternalEvents are always a single
item per event. Also remove the special DeviceValuator handling in both
enqueueing and dequeueing.

Custom callback handlers are now broken until fixed.

For bisectability, we copy the InternalEvent back into the XI required during
POE and friends. Consider this a temporary solution.

Note: Because of misc linker bonghits, Xvfb won't link in this revision.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-02-23 17:52:39 +10:00
Peter Hutterer
5a827593f9 dix: switch event generation to InternalEvents.
GPE, GKVE, GProxE generate InternalEvents now.
DeviceClassesChangedEvents generates an InternalEvent now, but incomplete! We
need to tack on the information about the new SD in the ClassesChanged events.

Note: To make the progress bisectable, we drop back into XI events at the end of the
Get*Events functions. So the rest of the server still uses XI events.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-02-23 17:52:39 +10:00
Peter Hutterer
a7e6424d99 dix: remove obsolete comment. Event lists should not be allocated by the DDX 2009-01-27 09:29:03 +10:00
Daniel Stone
18e51911f5 Input: Add postdown to ButtonClassRec
This mirrors that in KeyClassRec: the state of the buttons as posted to
GetPointerEvents, rather than the state of the buttons as processed by
ProcessOtherEvent and friends.

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
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
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
d36adf52a2 dix: fix WarpPointer calls for devices with custom valuator ranges (#19297)
If the MD's lastSlave was a devices with custom axes ranges, then a
WarpPointer would position the cursor at the wrong location. A WarpPointer
request provides screen coordinates and these coordinates were scaled to the
device range before warping.

This patch consists of two parts:
1) in the WarpPointer handling, get the lastSlave and post the event through
   this device.
2) assume that WarpPointer coordinates are always in screen coordinates and
   scale them to device coordinates in GPE before continuing. Note that this
   breaks device-coordinate based XWarpDevicePointer calls (for which the spec
   isn't nailed down yet anyway) until a better solution is found.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-01-13 09:22:56 +10:00
Peter Hutterer
56efbc0986 dix: drop x/y back into last.valuators before updating the history (#19285)
positionSprite needs to scale to screen coordinates and in the process of
doing so alters dev->last.valuators[0:1]. Drop the real coordinates back after
finishing and before updating the motion history. This way, we don't push the
screen coordinates into the motion history.

X.Org Bug 19285 <http://bugs.freedesktop.org/show_bug.cgi?id=19285>
2009-01-12 11:44:10 +10:00
Peter Hutterer
a3f9e887d9 dix: don't accept Button 0 presses in GPE. 2009-01-09 16:08:37 +10:00
Peter Hutterer
689be0cb4b dix: set the correct length in CreateClassesChangedEvent.
Fallout from aeff14d5f2. Yes, we don't malloc
anymore because we are inside a SIGIO and the memory is already there anyway.
But we still need to set the event length correctly, otherwise
mieqEnqueue/mieqProcessInputEvent don't know how much memory to copy.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2008-12-18 09:58:42 +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
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
Peter Hutterer
0b4fef6337 dix: move MAX_VALUATOR_EVENTS into include/input.h
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2008-12-10 12:42:45 +10:00
Peter Hutterer
ee1a6c2841 dix: fix calculation of valuator events.
Follow-up to 4971315296. countValuatorEvents was copied from GKVE where it
was obviously broken but nobody noticed. GPE had the correct version, but that
one got lost during de-duplication. Restoring the correct calculation - if we
have 6 valuators, we want 1 valuator event, not 2.

Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
2008-12-08 12:05:52 +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
e670fd8896 dix: fix GetMaximumEventsNum(), may return a DCCE event too.
Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
2008-12-03 16:10:40 +10:00
Peter Hutterer
5d02e580d7 dix: use UpdateFromMaster in GetProximityEvents.
Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
2008-12-02 15:50:38 +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
4971315296 dix: clean up GetPointerEvents and GetKeyboardValuatorEvents.
Split into several functions, remove some stale comments.

Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
2008-11-04 16:02:25 +10:30
Daniel Stone
d9ff20e323 DIX: Remove unnecessary prototype
We don't call XkbCopyKeymap from getevents.c anymore, so axe it.

Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
2008-11-04 16:01:42 +10:30
Peter Hutterer
5d0a945a03 dix: SwitchCorePointer is long gone, bury it. 2008-10-31 17:09:13 +10:30
Tiago Vignatti
d1bb5e3b47 mi: functions here are carrying 'time' without need. 2008-10-08 03:41:17 -03:00
Peter Hutterer
9c8a2be2c7 dix: fix axis scaling.
For two axes [a, b] and [x, y] (inclusive), the formula to scale point P(ab)
to (x,y) is:
    (P - a)/(b - a) * (y - x) + x

And the whole end result rounded of course to get the integer we need.
2008-10-03 15:27:07 +09:30
Peter Hutterer
93ef72fa26 dix: don't lose subpixel precision when scaling.
Only scale x/y back from screen range if we have crossed screen, otherwise
leave it as it is.
2008-10-03 15:27:07 +09:30
Peter Hutterer
609c04b62b dix: stick a warning in about loss of subpixel precision. 2008-08-15 14:52:13 +09:30
Peter Hutterer
465a9bb96e dix: don't try to create events if we don't have a screen. #16898
A NULL screen may happen during server shutdown, when the output has been shut
down but the devices still generate events.

X.Org Bug 16898 <http://bugs.freedesktop.org/show_bug.cgi?id=16898>
2008-08-08 17:37:06 +09:30
Peter Hutterer
6ca34549b8 dix: remove obsolete FIXME comment.
Thanks to Simon Thum for pointing this out.
2008-08-08 16:19:20 +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
Ander Conselvan de Oliveira
c42427f63f Fix incorrect test regarding keyboard map.
In the map stored in each keyboard device, the first line refers to
minimum keycode, i.e., the 0th line refers to keycode 8. When not
using XKB the wrong test caused some keys to be interpreted as
locks ('m' for instance). The had to be pressed twice to generate
both KeyPress and KeyRelease events.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2008-07-10 17:27:13 +09:30
Peter Hutterer
3a2beb2f86 dix: InitEventList does not need to be _X_EXPORT. 2008-06-25 20:03:31 +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