Commit Graph

168 Commits

Author SHA1 Message Date
Magnus Vigerlöf
5ffbcfec3d dix: Ensure Proximity events don't kill the server.
Add Prox events to the if-clauses with the other events
that are usually sent from the input devices.
Ensure that the event deliverers won't try to deliver
events of type '0' (some extended events doesn't have
an equivalent core-type)

Small modification by Peter Hutterer.

Signed-off-by: Peter Hutterer <peter@cs.unisa.edu.au>
2008-04-08 14:43:22 +09:30
Peter Hutterer
b81c330f70 mi: remove RawDeviceEvent's ID changing. 2008-02-14 09:32:54 +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
Bartosz Fabianowski
5b02a6ca5b Input: Fix proximity events with valuators
Initialise num_events to 1, so we always send a proximity event, and then
optionally valuator events.  Also make sure mieq can deal with valuator
events sent after proximity events.
2007-12-14 13:15:26 +02:00
Peter Hutterer
c5acf401da mi: unify last two ErrorF's in mieq.c 2007-12-07 20:19:43 +10:30
Peter Hutterer
117458d2db mi: change infamous "Tossed event ..." error for something more explanatory.
Few whitespace errors fixed.
Two ErrorF's prefixed with [mi].
2007-12-07 20:18:49 +10:30
Eamon Walsh
60be452c2e xace: restore the old SaveScreens function and introduce new API, since the
old version is called from drivers...
2007-11-19 16:59:34 -05:00
Peter Hutterer
a08665d4d3 mi: don't call SwitchCoreKeyboard, we switch during event processing now. 2007-11-15 10:42:29 +10:30
Peter Hutterer
51239f87ce dix: Send MappingNotify when keyboard maps change.
If a slave device is attached to a master device, then we need to send a
mapping notify to the client.
Mapping notify needs to be sent if
 - different slave device but on same master
 - different master

This gives you funny behaviour with the ClientPointer. When a
MappingNotify is sent to the client, the client usually responds with a
GetKeyboardMapping. This will retrieve the ClientPointer's keyboard mapping,
regardless of which keyboard sent the last mapping notify request. So
depending on the CP setting, your keyboard may change layout in each app...
2007-11-13 11:26:16 +10:30
Peter Hutterer
5a7a65a3c9 mi: avoid SIGABRT by setting master_event to NULL. 2007-11-12 12:37:39 +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
3063f0c667 mi: change the device id to the master devices' when duplicating the event.
Move the event duplication into a CopyGetMasterEvent(), makes the code a bit
better to read.
2007-11-08 11:51:03 +10:30
Peter Hutterer
15944b8f02 mi: duplicate event before processing it, so master has original values
Event values may get changed in the event processing stage, so we need to
duplicate it to pump different events through for slave and master device.
2007-11-07 11:33:24 +10:30
Peter Hutterer
8b7c4249d8 mi: call processInputProc for master devices after slave event processing.
More work is needed to sort out grabs though.
2007-10-17 10:41:58 +09:30
Peter Hutterer
2b075e97ec mi: switch core keyboard on XI events, not only on core events.
We only get core events through the EQ in exceptional cases, so make sure we
actually swap the core keymap for XI events as well. Gives us back the ability
to have multiple keyboard layouts simultaneously.
2007-10-02 13:28:40 +09:30
Peter Hutterer
a511c445de Remove generation of core events, long live XI!
Let the drivers only generate XI events and put those into the event queue.
When processing events, generate core events as needed. This fixes a number of
problems with XKB and the DIX in general.

The previous approach was to put core events and XI events as separate events
into the event queue. When being processed, the server had no knowledge of
them coming from the same device state change. Anything that would then change
the state of the device accordingly was in danger of changing it twice,
leading to some funny (i.e. not funny at all) results.

Emulating core events while processing XI events fixes this, there is only one
path that actually changes the device state now. Although we have to be
careful when replaying events from synced devices, otherwise we may lose
events.

Note: XI has precedence over core for passive grabs, but core events are
delivered to the client first.

This removes the wrapping added in 340911d724
2007-09-28 18:46:41 +09:30
Peter Hutterer
340911d724 Wrap core event handling through ProcessOtherEvents.
When processing events from the EQ, _always_ call the processInputProc of the
matching device. For XI devices, this proc is wrapped in three layers.
Core event handling is wrapped by XI event handling, which is wrapped by XKB.
A core event now passes through XKB -> XI -> DIX.

This gets rid of a sync'd grab problem: with the previous code, core events
did disappear during a sync'd device grab on account of mieqProcessInputEvents
calling the processInputProc of the VCP/VCK instead of the actual device. This
lead to the event being processed as normal instead of being enqueued for
later replaying.
2007-09-26 15:12:49 +09:30
Eamon Walsh
b82557c9fb xace: add hooks + new access codes: core protocol screensaver requests 2007-08-16 10:36:05 -04:00
Peter Hutterer
9eddede039 mieqEnqueue: Don't try to update the time for GenericEvents.
Doing so may overwrite the event's length field and cause havoc. Also check if
realloc'd memory did actually return valid pointer.
2007-08-06 15:48:22 +09:30
Peter Hutterer
49136d3e9f mieqEnqueue: use modulo for queue tail wrapping.
This was previously committed by Michael Daenzer, but was lost during a pull.
2007-06-27 11:58:12 +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
Michel Dänzer
40f27a2df4 mieqEnqueue: Make local queue tail variables unsigned.
So the modulo arithmetic actually works as intended... thanks to Peter Hutterer
for pointing out the problem.
2007-06-19 09:11:16 +02:00
Michel Dänzer
30a3297fed mieq queue handling cleanups.
In particular, fix handling of wraparounds in mieqEnqueue.
2007-06-11 09:23:18 +02:00
Peter Hutterer
58c0fd2927 Adjust EQ to support long events.
Add RawDeviceEvent (pointers only for now).

This commit changes the event queue to use EventLists instead of xEvent
arrays. Only EQ is affected, event delivery still uses xEvent* (look for
comment in mieqProcessInputEvent).

RawDeviceEvents deliver driver information to the client, without clipping or
acceleration.
2007-05-02 13:50:09 +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
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
Daniel Stone
e49f836d6f mieq: Use larger default queue size
Use a default queue size of 512 rather than 256, else Xephyr is too slow
without a host cursor, so events get stuck in the queue.
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
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
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
Daniel Stone
80d29475b9 mieq: Allow event handlers for arbitrary events to be set
Allow arbitrary events to use mieq by letting custom handlers be set.
2007-03-21 00:10:38 +02:00
Peter Hutterer
a309c936bb xkb: Daniel's patch to stop evdev keyboard segfaults.
mi:	Remove quickfix from ba547d4f6a
2007-02-05 11:38:44 +10:30
Peter Hutterer
15a81b6325 Merge branch 'master' 2007-01-28 17:18:57 +10:30
Peter Hutterer
ba547d4f6a mi: Quick fix to stop segfault on non-core keyboards. 2007-01-12 14:42:02 +10:30
Peter Hutterer
5e2f8dee63 mi: remove core pointer special handling. No event has core pointer as
device now.

dix:    zero pSprite memory, stop segfaults on server restart.
2007-01-11 14:05:39 +10:30
Fredrik Höglund
3b5b7ef5c2 Move the code for resetting the DPMS mode in response to input events,
from WaitForSomething to mieqProcessInputEvents.

mieqProcessInputEvents already handles resetting the screen saver.
2007-01-03 21:05:35 +01:00
Peter Hutterer
d8b5394eda Cleaning up ifdef MPX from remaining files, removing it from configure.ac.
Removing building mpx extension from Makefile.am
2006-12-18 17:35:34 +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
e88bc0e55a mi: Bugfix: FreeCursor ignores negative refcounts.
mieq:   Bugfix: Motion notifies did overwrite DeviceMotionNotifies
2006-11-28 14:34:36 +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
9db851c22d dix: moved sprite from static to be pointer of type SpritePtr
added SpriteRecs for MPX devices
	changed sprite dependency and added MPX functionality to parts
	of events.c (ConfineToShape, PostNewCursor, XineramaCheckMotion,
	CheckMotion, XineramaChangeToCursor, ChangeToCursor, CheckPhysLimits,
	PointerConfinedToScreen)
	added DeviceIntRec param to GetSpritePosition(). This required some
	minor changes in ddx, xtest, xkb and xfixes.

mi:	changed miPointer to pointer instead of static struct.
2006-11-21 18:15:04 +10:30
Peter Hutterer
90bea69dfd mi:
added miCursorInfoRec to contain info of the MPX cursors.
        calling miUpdatePointerSprite() from event queue for MPX devices.
        adding device-specific processing to miPointer*() functions.

dix:    Call to SetCursorPosition in CheckMotion() temporarily disabled.

xfree86/common: call to miPointerUpdateSprite() disabled, is done from the EQ

NOTE: This build will not display cursor images.
BUG: The second mouse does to take correct x coordinates.
2006-11-17 18:03:43 +10:30
Peter Hutterer
5388423eb0 mieq: EQ processing handles MP devices
global: MPX define added to xorg-server.h.in

xfree86/common: small fix to avoid byte overflow
2006-11-16 20:43:27 +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
c51fadc07d mieq: annotate with some more comments 2006-11-08 15:29:15 +02:00
Daniel Stone
a5be654017 mieqEnqueue: only compare DEVICE_BITS of deviceid
Only compare DEVICE_BITS of the two deviceids, so we don't decide that
a valuator event isn't for us, because (id | MORE_EVENTS) != id.
2006-10-27 01:25:21 +03:00
Daniel Stone
77e724585f minor formatting fixes 2006-10-22 11:45:12 +03:00
Daniel Stone
aeba855b07 move keymap copy to event processing, from enqueuing
Move the keymap copying to event processing time (in
ProcessInputEvents), instead of being at event enqueuing time.
Break SetCore{Pointer,Keyboard} out into separate functions.
Change mieqEnqueue to take a device pointer, that asks for the
_original_ device associated with this event.
2006-10-20 00:43:11 +03:00
Daniel Stone
41bb9fce47 mipointer: take device arguments, split miPointerAbsoluteCursor
Update mipointer API to take a device argument to (almost) all functions,
and split miPointerAbsoluteCursor into a couple of separate functions.
Remove miPointerAbsoluteCursor call from mieq, as we now deal with it in
GetPointerEvents.
Make miPointerSetPosition (successor of miPointerAbsoluteCursor) take
pointers to x and y, so it can return the clipped values.
Modify callers of miPointer*() functions to generally use the new
functions.
This should fix things with multi-head setups.
2006-10-08 20:34:32 +03:00
Daniel Stone
ef68273f5b mi/mipointer: deprecate functions which don't take a device
Deprecate all mi pointer functions which don't take a device argument, and
replace them with versions which do, in preparation for MPX.
2006-10-08 17:44:37 +03:00
Daniel Stone
2cf1098436 dix/events, mi/eq: remove utterly ridiculous debugging
Remove debugging which can cause long-lived Xorg logs to grow well above 1GB
if built with --enable-debug.
2006-09-30 17:05:46 +03:00
Daniel Stone
5e9d33fe87 Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver into input-hotplug 2006-09-07 15:43:31 +03:00
Michel Dänzer
8356be492c Make sure _XSERVER64 is defined when it should be and gets tested. 2006-09-06 15:20:55 +02:00
Daniel Stone
5c7001fef8 memcpy() events in
memcpy events into our event structure instead of doing pointer assignment.
2006-08-07 16:51:09 +03:00
Daniel Stone
a406f6bfea mieq: don't leak events
free all events posted through mieqEnqueue.
2006-08-04 12:40:19 +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
f18c3122a5 sanitise debug output
Don't spit out huge chunks of pointless ephemera, especially without
--enable-debug.
2006-07-21 15:19:54 -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
292c4cff26 Fix includes right throughout the Xserver tree:
change "foo.h" to <X11/foo.h> for core headers, e.g. X.h, Xpoll.h;
change "foo.h", "extensions/foo.h" and "X11/foo.h" to
    <X11/extensions/foo.h> for extension headers, e.g. Xv.h;
change "foo.[ch]" to <X11/Xtrans/foo.[ch]> for Xtrans files.
2005-04-20 12:25:48 +00:00
Keith Packard
1e694d2b51 Fix minor timestamp lossage in mieq.
Replace miSprite implementation with Damage-based one. Otherwise damage and
    misprite conflict causing looping.
Change pScreen usage around a bit to eliminate warnings
2004-08-07 01:23:07 +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
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