Commit Graph

171 Commits

Author SHA1 Message Date
Peter Hutterer
1e24e7b9df Xi: remove configure/query device property calls.
This removes all the meta-information about device properties (pending,
fromClient, range, valid_values, immutable).
2008-09-26 13:32:05 +09:30
Adam Jackson
d6228cb22a Shape extension is built-in and mandatory. 2008-07-24 15:46:08 -04:00
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
Simon Thum
0050165a67 input: change dxremaind, dyremaind to floats for better acceleration #9156
X.Org Bug 9156 <http://bugs.freedesktop.org/show_bug.cgi?id=9156>

Signed-off-by: Peter Hutterer <peter@cs.unisa.edu.au>
2008-05-26 17:58:07 +09:30
Peter Hutterer
d22c25bda4 dix: Allocate MD's motion history to be large enough for potential valuators
Since we can't predict how many valuators may be in a future SD attached to an
MD, we need to preallocate a history buffer that is large enough to keep
MAX_VALUATORS coordinates per event.

In addition, the history buffer needs to memorize the coordinate ranges at the
time, thus requiring MDs to store (min_val, max_val, current_val, time)
instead of (current_val, time) for each motion history entry.

This commit only fixes the allocation.
2008-05-26 09:26:18 +09:30
Peter Hutterer
0877de13ac Remove GetMotionProc from ValuatorClassRec.
With the MD/SD device hierarchy we need control over the generation of the
motion history as well as the conversion later before posting it to the
client. So let's not let the drivers change it.

No x.org driver currently uses it anyway, linuxwacom doesn't either so dumping
it seems safe enough.
2008-05-25 22:49:54 +09:30
Peter Hutterer
fe59b1a62b dix: more device scaling insanity.
Assuming master->last.valuators is in screen coords, SD's are always in device
coordinates.

1. If an event comes in, scale masters->last to the device, drop into device's
last->valuators.
2. Apply motion from the actual event
3. Scale back to screen coords, check if we may need to cross screens
4. Drop screen coords into master->last
5. Rescale to device coords, drop into deviceValuator event and SD->last
6. Drop screen coords into ev->root_x/y

Whoopee...
2008-05-23 12:51:52 +09:30
Peter Hutterer
6c9e9f8a40 input: instead of lastx/y, use a last.valuators[] array on the device.
During GetPointerEvents (and others), we need to access the last coordinates
posted for this device from the driver (not as posted to the client!). Lastx/y
is ok if we only have two axes, but with more complex devices we also need to
transition between all other axes.

ABI break, recompile your input drivers.
2008-05-23 12:01:37 +09:30
Peter Hutterer
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
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
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
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
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
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
Peter Hutterer
b6ccf721b0 include: add "lastSlave" field to DeviceIntRec.
Set to the last slave device that routed events through the master.
2007-10-16 17:35:06 +09:30
Peter Hutterer
204f2dc89e include: add "isMaster" field to DeviceIntRec.
Set to TRUE for master devices.

Also fixing up comment for paired field in spriteInfo, will be set
bidirectional from now on.
2007-10-16 11:19:09 +09:30
Peter Hutterer
ce9bf9a191 include: add "master" field to DeviceIntRec.
"master" points to the device this device is attached to. Event sent by the
device will also be routed through the master.
master and spriteOwner are mutually exclusive.
2007-10-16 11:05:23 +09:30
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
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
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
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
5ccc09b182 Use the same struct for generic event masks throughout the code.
Renaming those structs too.

Previously grabs were using a different struct than windows, which was
reasonably stupid.
2007-07-06 15:43:08 +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
Peter Hutterer
26b21157cf Add a deviceMask to the GrabRec and don't interfere with passiveGrabs.
This quickfixes event delivery problems with XI events when a grab was on.
deviceMask is only used when the grab was from a ButtonPress to preserve
potential XI event masks.

This is not an ideal solution but it works until I have time to work on
PassiveGrabs.
2007-05-31 17:05:14 +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
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
b6aec7f6f9 Change FocusIn/Out semantics to match Enter/Leave semantics. 2007-04-17 16:51:16 +09:30
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
Adam Jackson
9a0f25de7c Static cleanups, dead code deletion. 2007-03-25 12:27:01 -04:00
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
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
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
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
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
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
Peter Hutterer
1c7568b8a1 mi: closing memory leak, miPointer is freed in miPointerCloseScreen
bugfix: uninitialized pPointer in miPointerGetPosition ifndef MPX
	adding DeviceIntPtr parameter to ScreenRec's cursor functions.
	cleanup of miPointer code to use same scheme in each function

dix:	MPHasCursor() function determines checking whether to invoke
	cursor rendering.

animcur: adding DeviceIntPtr parameter to cursor functions but animcur relies
	 on the core pointer right now.

xfixes: adding DeviceIntPtr parameter to cursor functions but xfixes relies on
	the core pointer right now.

rac:	adding DeviceIntPtr parameter to cursor functions but RAC relies on
	the core pointer right now.

ramdac:	adding DeviceIntPtr parameter to cursor functions but ramdac relies on
	the core pointer right now.
2006-11-23 17:15:14 +10:30
Peter Hutterer
94e106a898 dix: moved isMPdev field to end of _DeviceIntRec structure
mi:
        added miMPPointers array to mipointer.c
        added DeviceIntPtr to all miPointerSpriteFuncs. Coming from miPointer
        we use inputInfo.pointer as standard value. ABI BREAK!

ramdac:
        forcing failed HW Cursor initialisation. MPX needs software rendering.
        changes to use new miPointerSpriteFunc (this required externing
        inputInfo, should probably be fixed at a later point).

RAC: changes to use new miPointerSpriteFuncs.
2006-11-17 15:10:37 +10:30
Peter Hutterer
c957a16180 dix: added isMPdev field to _DeviceIntRec, is used in GetPointerEvents()
mieq:   avoid merging events from different devices in mieqEnqueue()

xfree86/common
        isMPdev field used from xf86ActivateDevice(), xf86PostMotionEvent()
        and xf86PostButtonEvent()
2006-11-16 15:11:14 +10:30
Daniel Stone
5b38eb69cd dix: add motion history support
Add motion history support (sort of based on the XFree86 DDX's
implementation) to the DIX.
2006-10-25 01:08:29 +03:00
Daniel Stone
37d1fffe79 inputstr: try to keep device structs the same size
Try to make sure DeviceIntRec and friends stay the same size,
regardless of whether or not XKB is enabled.
2006-10-24 23:06:57 +03:00
Daniel Stone
9f9ac01a81 inputstr: fix indentation 2006-10-24 23:01:05 +03:00
Daniel Stone
bf4df9b73f include: move POINTER_* flags from inputstr.h to input.h
Given they're just numeric constants, they should be included in
input.h, not inputstr.h.
2006-10-23 02:50:53 +03:00
Zephaniah E. Hull
e26a494f41 Merge branch 'input-hotplug' of git+ssh://git.freedesktop.org/git/xorg/xserver 2006-10-21 04:26:14 -04:00
Zephaniah E. Hull
736b0d5078 DEVICE_TOUCHSCREEN becomes DEVICE_ABS_CALIB.
Update the DEVICE_ABS_CALIB stuff to include the new elements.

New DEVICE_ABS_AREA support.

dev->touchscreen becomes dev->absolute, with _CALIB and _AREA stuff in it.

Update xfree86 to compile with this, kdrive needs an update too.
2006-10-21 04:24:49 -04:00
Daniel Stone
a8d3dad9d9 xi: add DEVICE_ENABLE control
Add DEVICE_ENABLE control, which allows runtime enabling and disabling
of specific devices.
2006-10-20 00:43:11 +03:00
Daniel Stone
7465010d59 Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver into input-hotplug 2006-07-21 19:05:41 -04:00
Adam Jackson
0aaac95b0d Remove RCS tags. Fix Xprint makefile braindamage. 2006-07-21 17:56:00 -04:00
Daniel Stone
1987af8c49 add virtual core devices to DIX
Add virtual core devices, with proper keymaps etc, to the DIX.
2006-07-21 15:19:53 -04:00
Daniel Stone
a274e7296b add GetPointerEvents/GetKeyboardEvents framework
Add GetPointerEvents (with XFree86 pointer acceleration) and GetKeyboardEvents
to the DIX.  Extend the ValuatorClass structure to account for same.
2006-07-21 15:19:51 -04:00
Daniel Stone
b308dbf273 add DEVICE_TOUCHSCREEN and DEVICE_CORE Xi controls (DeviceIntRec ABI break)
Add DEVICE_TOUCHSCREEN and DEVICE_CORE controls to the Xi code, and the
TouchscreenClassRec and a coreEvents flag, to toggle propagation of core
events.
2006-07-21 15:19:50 -04:00
Daniel Stone
825a95a1fa Remove use of dix-config and xorg-config.h from public headers. 2005-08-24 11:18:35 +00:00
Daniel Stone
e03198972c Add Xtrans definitions (FONT_t, TRANS_CLIENT) to clean up warnings.
Add XSERV_t, TRANS_SERVER, TRANS_REOPEN to quash warnings.
Add #include <dix-config.h> or <xorg-config.h>, as appropriate, to all
    source files in the xserver/xorg tree, predicated on defines of
    HAVE_{DIX,XORG}_CONFIG_H. Change all Xfont includes to
    <X11/fonts/foo.h>.
2005-07-03 07:02:09 +00:00
Stuart Kreitman
71164d118c Integration of XEVIE branch to trunk
https://freedesktop.org/bugzilla/show_bug.cgi?id=947
Modified Files: cursorstr.h input.h inputstr.h windowstr.h
2004-07-30 01:21:57 +00:00
Egbert Eich
2fb5886200 Merging XORG-CURRENT into trunk 2004-04-23 19:54:30 +00:00
Egbert Eich
dae90c3af9 Importing vendor version xf86-4_4_99_1 on Sun Mar 14 00:26:39 PST 2004 2004-03-14 08:34:49 +00:00
Egbert Eich
867451f1ab Importing vendor version xf86-4_4_0 on Wed Mar 3 04:09:24 PST 2004 2004-03-03 12:12:50 +00:00
Egbert Eich
df0313d35b readding XFree86's cvs IDs 2004-02-26 13:36:15 +00:00
Egbert Eich
147aae87fd Importing vendor version xf86-4_3_99_903 on Wed Feb 26 01:21:00 PST 2004 2004-02-26 09:23:53 +00:00
Kaleb Keithley
adc7f9a4eb XFree86 4.3.99.16 Bring the tree up to date for the Cygwin folks 2003-11-25 19:29:01 +00:00
Kaleb Keithley
d568221710 XFree86 4.3.0.1 2003-11-14 16:49:22 +00:00
Kaleb Keithley
ded6147bfb R6.6 is the Xorg base-line 2003-11-14 15:54:54 +00:00