Commit Graph

653 Commits

Author SHA1 Message Date
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
Jeremy Huddleston
bcbaf2a0ce Darwin: Dead code removal, Code cleanup, Added launcher
Imported changes from xorg-server-1.2-apple to make master more current wrt
file layout, build system changes, and dead code removal.
2007-11-21 19:52:11 -08:00
Eamon Walsh
709c1a70c8 Remove some duplicate include statements. 2007-11-20 15:18:02 -05:00
Eamon Walsh
2d17f47cc7 Merge branch 'master' into XACE-SELINUX
Conflicts:

	hw/xnest/Pixmap.c
	include/dix.h
2007-11-19 18:10:46 -05:00
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
bad96e5a86 dix: getevents.c remove trailing whitespaces. 2007-11-18 15:13:45 +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
Adam Jackson
20fd478324 Small static cleanups on dix/ 2007-11-15 17:01:33 -05:00
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
Peter Hutterer
64711a0948 Xi: When switching MD classes, make a deep copy instead of pointer flip.
Turns out it's really really hard synchronising device state across multiple
duplicated events if they all share the same struct. So instead of doing so,
when the SD changes deep-copy all it's classes into the MD. The MD then has
the same capabilities, but the state can be set separately. This should fix
xkb, key state, repeat etc. problems.

Updating the device state allows us to remove the SwitchCoreKeyboard from the
event gathering, it's all done during event processing now.
2007-11-15 10:41:34 +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
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
70b4087c4d dix: don't unconditionally update valuators during key events.
Master may not have valuators, device may not have valuators.
2007-11-12 13:10:39 +10:30
Peter Hutterer
23365d2865 dix: allow grab modifier device to be NULL.
This can happen if we check for a passive core grab and our device is a
floating slave device. Doesn't really change anything as SDs can't send core
events but it stops the server from segfaulting.
2007-11-12 13:08:38 +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
5bbc468b70 dix: grabbing an attached SD sets it floating for the duration of the grab. 2007-11-09 14:32:06 +10:30
Peter Hutterer
cb75f09146 dix: calloc root window's Generic Event mask, stops segfaults. 2007-11-09 14:31:41 +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
e717409bae DIX/getevents: Document GetMaximumEventsNum() a little better
Note that the number returned by GMEN can _never_ change, and be a little more
explicit about the figure for repeats.
2007-11-07 03:58:56 +02:00
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
d7c5e8bfc1 Modified performance patches from Arjan van de Ven <arjan@infradead.org>
Subject: [PATCH] fix some performance gaps in Xace

The XaceHook function is used in several hotpaths.
The problem with it (performance wise) is twofold:
 * The XaceHook function has a big switch() statement for the hook number in it
 * The XaceHook function uses varargs to reassemble the final dispatch arguments again

Both are expensive operations... for something that is known at compile time

This patch turns the hotpath XaceHook call into a direct call to avoid
the switch and varargs; this gives me over 10% performance gain
on the x11perf benchmark.
2007-11-06 16:26:09 -05: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
dda10c9066 Remove all traces of external RGB database (and Speedo)
Remove all references to an external RGB database (which hasn't been enabled
for a very long time).  Also get rid of some references to Speedo fonts.
2007-11-05 16:28:35 +00:00
Daniel Stone
83e5d9e75d DIX: Remove last alloca call
Replace with heap allocations.
2007-11-05 14:36:54 +00:00
Daniel Stone
914922fd61 DIX: Remove usage of alloca
Replace with heap allocations.
2007-11-05 14:34:43 +00:00
Ben Byer
6e4f5cf83f changing ALLOCATE_LOCAL to xalloc to prevent stack overflow 2007-11-05 05:53:34 -08:00
Aaron Plattner
f2e310132f Add CreatePixmap allocation hints.
These hints allow an acceleration architecture to optimize allocation of certain
types of pixmaps, such as pixmaps that will serve as backing pixmaps for
redirected windows.
2007-11-04 16:11:28 -08:00
Adam Jackson
f01e149d1a Move SIGUSR1 notification as late as possible.
If we inherited a signal mask from the parent process that ignores SIGUSR1,
then we will send SIGUSR1 to the parent to indicate when we're ready to
accept connections.  Unfortunately, we send this notification way too
early, right after creating the sockets rather than just before entering
the main loop.

Move it to just before Dispatch() so we're not lying quite so much.
2007-11-02 11:54:16 -04:00
Peter Hutterer
352c5a3112 dix: don't compress motion events from different devices (EventEnqueue)
(cherry picked from commit 8840829ab9)
2007-10-28 16:07:30 +02:00
Peter Hutterer
8d3d027062 dix: add XI event support to FixKeyState.
FixKeyState needs to be able to handle XI events, otherwise we get "impossible
keyboard events" on server zaps and other special key combos.
(cherry picked from commit 5ee409794e)
2007-10-28 16:05:04 +02:00
Eamon Walsh
5f9095f0d2 registry: Remove synthetic bit from event types in lookup function. 2007-10-25 19:09:26 -04:00
Eamon Walsh
8c6923018c xace: Add a "manage" access check when setting the Redirect event bits. 2007-10-25 19:01:29 -04:00
Naoki Hamada
242f56f722 Input: Fix key down test (bug #12858)
Fix the botched previous key_is_down test, which would give false positives.
Also move key_autorepeats to a separate inline function.
2007-10-25 18:46:27 +03:00
Eamon Walsh
0388a59a6e Revert "registry: special case minor number when looking up core requests."
This reverts commit 31110d6837.

This is handled properly by StandardMinorOpcode().
2007-10-23 20:59:21 -04:00
Peter Hutterer
b7ee005d32 dix: Don't interfere grabs the interfering device is of different type.
A pointer device should be able to send events while the client has a core
grab on a keyboard device, and likewise.
2007-10-24 10:26:12 +09:30
Peter Hutterer
02508614b9 dix: check for core passive grabs on inferiors when replaying events. 2007-10-24 10:09:18 +09:30
Eamon Walsh
825f09dffd xace: Still more changes to selection code. Removed the SelectionPtr from
the hook - the hook only needs the Atom to control access to the selection
object.  Upgraded the SelectionCallback to take a client argument and
additional type codes so that it can be used for redirection.
2007-10-23 17:12:57 -04:00
Eamon Walsh
9e0a468af1 xace: try to pretend events were sent when a denial occurs.
Probably need to redo the error return paths in these functions
at some point.
2007-10-23 13:35:30 -04: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
Eamon Walsh
12e889d202 xace: Bug fixes, name changes to selection access hooks and fields. 2007-10-19 18:43:38 -04:00
Peter Hutterer
5ba738935f Xi: remove ChangePointerKeyboardPairing in favour of ChangeDeviceHierarchy. 2007-10-19 14:36:37 +09:30
Eamon Walsh
06eb830169 xace: Fix bug in AddPassiveGrabToList(), was using wrong GrabPtr. 2007-10-18 12:31:14 -04:00
Eamon Walsh
6107a24503 dix: Add client parameter to AddPassiveGrabsToList(). 2007-10-18 12:24:55 -04:00
Eamon Walsh
31110d6837 registry: special case minor number when looking up core requests. 2007-10-18 10:30:44 -04:00
Eamon Walsh
e3fd90ae9c registry: Add "X11:" prefix to core protocol names. 2007-10-18 10:29:10 -04:00
Eamon Walsh
c3f7b86255 Merge branch 'master' into XACE-SELINUX
Conflicts:

	os/access.c
2007-10-17 15:00:54 -04:00
Eamon Walsh
e3a8cbe523 xace: add creation/labeling hook to CreateRootWindow(). 2007-10-17 13:48:44 -04:00
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
b697c4ed14 dix: CheckPassiveGrabOnWindow: only get paired device for non-keyboards. 2007-10-16 17:47:06 +09:30
Peter Hutterer
caa69d8f7b dix: fix detritus from adding lastSlave field. 2007-10-16 17:38:13 +09:30
Peter Hutterer
90d077e537 dix: GetPointerEvents: get state from master device before applying valuators.
We need to get lastx/y from the master device before we start applying
acceleration etc. Otherwise we get jumping cursors, which is reasonably bad.
2007-10-16 17:37:33 +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
c7b878b904 dix: don't treat VCK/VCP separately in DevHasCursor, IsPointer/KeyboardDevice. 2007-10-16 15:07:31 +09:30
Peter Hutterer
e9f149fb56 Fix up detritus from removing GetPairedPointer/Keyboard. 2007-10-16 14:24:20 +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
9ecbbf198f dix: adjust PickPointer and PickKeyboard to get the first master device.
Simplifies it a lot, since we always have at least one master device
available at all times, so less mucking around.
2007-10-16 12:05:09 +09:30
Peter Hutterer
0c5f65ecd3 dix: don't allow slave devices as ClientPointer 2007-10-16 12:04:56 +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
Eamon Walsh
6adeba1730 dix: Add a new "registry" mechanism for registering string names of things.
Supports protocol requests, events, and errors, and resource names.
Modify XRES extension to use it.
2007-10-11 14:18:59 -04:00
Eamon Walsh
8f23d40068 xace: move the property deletion hook inside the DeleteProperty function. 2007-10-10 19:56:03 -04:00
Eamon Walsh
473bc6ec4c xace: remove the special-cased "ignore" functionality from the property code.
There will be no more faking of Success to hide things.  XACE does not
provide polyinstantiation.
2007-10-10 19:43:12 -04:00
Eamon Walsh
7e9e01a4a3 dix: pass a valid ClientPtr to SetFontPath in all cases. 2007-10-10 17:40:22 -04:00
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
Peter Hutterer
1eebb03a31 dix: ignore passive grab if the client already has a grab on the device.
In some cases a button press may activate a passive core grab. If the client
owning the passive grab already has a core grab on another device, don't
actually activate it. Otherwise the client gets two simultaneous passive
core grabs, and may never ungrab the device again (only if the other grab uses
GrabModeSync).

Reproducable: fire up gnome-session, open up gnome-terminal. Click with the
ClientPointer onto the window decoration, then click with another pointer onto
an application icon in the panel. Drag the icon out, release the button and
voila - you just lost your second mouse.
2007-10-03 15:18:17 +09:30
Peter Hutterer
0b48506782 dix: send NotifyGrab/NotifyUngrab focus events regardless of semaphore state.
This is just papering over a problem. The whole focus system needs to be
revised.
2007-10-03 14:22:55 +09:30
Peter Hutterer
05106ac983 dix: change Enter/Leave semaphore handling to accommodate for NotifyGrab.
This is a half-assed attempt at getting rid of some enter-leave problems. When
a grab is activated, the events didn't get sent before, leading to interesting
results. This commit papers over it but doesn't actually fix it properly. The
whole enter/leave (focusin/out) structure needs to be ripped out and changed
for multiple devices.
2007-10-03 11:33:10 +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
Dodji Seketeli
8c78df0ea3 Xserver: fix potential crash
* dix/extension.c:
	  (AddExtensionAlias): don't crash when failed to add
	  extension alias.
2007-10-02 16:55:15 +02:00
Dodji Seketeli
81692b628f Fix #12650: "windows not receiving mouse events in multiple screens context"
* dix/events.c, include/dix.h:
	  (UpdateSpriteForScreen): added this to update the mouse sprite context
	   when we switch from a pScreen to another.
	* mi/mipointer.c:
	  (miPointerWarpCursor): as we are switching to a new pScreen,
	   don't forget to update the mouse sprite context.
2007-10-02 13:48:48 +02:00
Peter Hutterer
f965a5f345 dix: Ignore devices when deleting passive core grabs. 2007-10-02 16:20:27 +09:30
Eamon Walsh
50551ec693 xace: remove obsoleted DRAWABLE_ACCESS hook. 2007-09-28 15:04:33 -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
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
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
Peter Hutterer
53434edc3d dix: take paired keyboard instead of VCK (CoreProcessPointerEvents) 2007-09-28 09:28:28 +09:30
Peter Hutterer
de06a47d4a dix: GetMaximumEventsNum() needs to return 3 + MAX_VALUATOR_EVENTS.
Raw events can be generated for pointer events, so 2 + MVE isn't enough.
2007-09-27 11:45:03 +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
Peter Hutterer
394f3c1dbe dix: GetPointerEvents: remove unused variable compiler warning. 2007-09-26 15:19:37 +09:30
Peter Hutterer
b2a4883bd8 dix: add comments to PlayReleasedEvents()
Also stick another warning in, more changes needed for XGE if panoramix is
active.
2007-09-26 09:20:11 +09:30
Peter Hutterer
275dc77c29 dix: add comments to ComputeFreezes() and syncEvents struct. 2007-09-26 09:14:50 +09:30
Eamon Walsh
9bd04055a2 xace: change prototype of VALIDATE_DRAWABLE_AND_GC macro to allow access
mode to be passed to dixLookupDrawable.
2007-09-25 09:33:51 -04:00
Peter Hutterer
5d9f6cf51b dix: cosmetic change. Remove "pointer" variable, might as well use pDev. 2007-09-24 12:38:11 +09:30
Peter Hutterer
1c25c46f3d dix: fix compiler warnings about unused variables. 2007-09-24 12:37:33 +09:30
Peter Hutterer
68e0c4988e dix: fix "possible use of uninitialized variable" warning.
The device passed through to UnrealizeCursor isn't used anyway, so setting it
to NULL is enough.
2007-09-24 12:21:05 +09:30
Peter Hutterer
b484451eab dix: don't try to access "time" field for GenericEvents in PlayReleasedEvent.
GenericEvents can't be parsed to keyButtonPointer, and there's no guarantee
that it has a time field anyway. PlayReleasedEvent needs to store the millis
when we know it (core events, XI event) and just re-use them for GenericEvents.

Yes, this is a hack. But it looks like the time has zero significance anyway.
2007-09-24 12:20:45 +09:30
Peter Hutterer
1c38eac442 dix: fix comment for DeliverDeviceEvents.
DDE is not always called, grabbed or focused devices go through
Deliver{Grabbed|Focus}Event first.

Thanks to Eamon Walsh for spotting it.
2007-09-24 12:15:53 +09:30
Peter Hutterer
06188ce90d dix: Make EnqueueEvent aware of GenericEvents.
GenericEvents can be > sizeof(xEvents), so we need to make sure we're
allocating and copying enough memory for the event.
2007-09-24 12:15:12 +09:30
Peter Hutterer
8840829ab9 dix: don't compress motion events from different devices (EventEnqueue) 2007-09-24 12:02:26 +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
Daniel Stone
0e800ca465 GetKeyboardEvents: Reject out-of-range keycodes (bug #12528)
We can only deal with keycodes between 8 and 255, so make sure that we never
accept anything out of this range.
2007-09-23 12:43:31 +03:00
Eamon Walsh
82f7195a62 xace: modifications to ChangeWindowAttributes special case: separate
Receive and SetAttr.  Refer to 963e69b8ef
2007-09-20 09:17:09 -04:00
Eamon Walsh
5b36b64192 xace: add missing argument to hook call. 2007-09-19 11:11:54 -04:00
Eamon Walsh
963e69b8ef xace: add special-case for just setting the event mask on a window,
this should only check "receive" permission, not "setattr" permission.
2007-09-19 11:11:41 -04: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
Eric Anholt
e4d11e58ce Remove the PaintWindow optimization.
This was an attempt to avoid scratch gc creation and validation for paintwin
because that was expensive.  This is not the case in current servers, and the
danger of failure to implement it correctly (as seen in all previous
implementations) is high enough to justify removing it.  No performance
difference detected with x11perf -create -move -resize -circulate on Xvfb.
Leave the screen hooks for PaintWindow* in for now to avoid ABI change.
2007-09-13 00:08:53 +00: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
Eamon Walsh
57907e0943 devPrivates rework: register an offset for every resource type, use
signed values so -1 actually works correctly, and provide a macro for
adding an offset to a pointer.
2007-09-06 16:55:51 -04:00
Peter Hutterer
5ee409794e dix: add XI event support to FixKeyState.
FixKeyState needs to be able to handle XI events, otherwise we get "impossible
keyboard events" on server zaps and other special key combos.
2007-09-06 18:52:02 +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
Eric Anholt
47300ed2be Fix server version reporting to be the server package version.
Previously, the server version reported by xdpyinfo and Xorg -version would
bear some vague resemblance to a X.Org katamari version, but in the presence
of modularization (and client-server relationships with different katamari
versions on each side) those numbers don't really make sense.  Instead, just
report the package version.

When branching a stable branch, master's version should be immediately updated
to the endpoint of the stable branch plus a snapshot of 1 (for example,
1.4.0.1 after server-1.4-branch).  The stable branch should then be changed to
RC0 at that time (1.3.99.0, for example).

This scheme was partially attempted for server 1.3, but lacked the appropriate
master updates, thus why it had to be revisited now.  While here, we can also
remove a lot of versioning complexity since everything is based on the package
version.
2007-09-05 12:43:28 -07:00
Eamon Walsh
0003ccfcdf xace: add new fields to resource access hook to allow parent resource objects
to be passed in at create time.  Also added a missing devPrivates initializer.
2007-09-05 11:18:36 -04:00
Peter Hutterer
c4fff05083 Revert "Input: Fix stuck modifiers (bug #11683)"
This reverts commit 6b055e5d97.

MPX relies on the XI event being delivered before the core event. Device grabs
break, amongst other things. I guess stuck modifiers need to be fixed some
other way.

Conflicts:

        dix/getevents.c
2007-09-05 16:19:45 +09:30
Eamon Walsh
1005b29cc6 xace: Correct some access modes. 2007-08-30 14:48:24 -04:00
Eamon Walsh
cda92bbf12 xace: add hooks + new access codes: XFixes extension.
Required a new name argument to the selection access hook to handle
XFixesSelectSelectionInput.
2007-08-30 11:48:45 -04:00
Eamon Walsh
47ab4d648b devPrivates rework: convert CursorRec and CursorBits over to new interface. 2007-08-30 11:40:39 -04:00
Eamon Walsh
e39694789e xace: drop map-window checking hook, add new hooks for controlling the
delivery of events to windows and clients.

This is tentative.  It's likely that an additional last-resort hook will
be necessary for code that calls TryClientEvents or WriteEventsToClient
directly.  It's also possible that new xace machinery will be necessary
to classify events and pull useful resource ID's out of them.

The failure case also needs some thinking through.  Should event delivery
"succeed" or should it report undeliverable?

Finally, XKB appears to call WriteToClient to pass events.  Sigh.
2007-08-29 14:16:46 -04: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
Eamon Walsh
8554707326 Merge branch 'master' into XACE-SELINUX
Conflicts:

	include/miscstruct.h
	mi/mibstore.c
	mi/midispcur.c
	os/Makefile.am
2007-08-28 07:25:21 -04:00
Adam Jackson
ae7f71a8b3 Implement core protocol backing store exclusively in terms of Composite.
Composite's automatic redirection is a more general mechanism than the
ad-hoc BS machinery, so it's much prettier to implement the one in terms
of the other.  Composite now wraps ChangeWindowAttributes and activates
automatic redirection for windows with backing store requested.  The old
backing store infrastructure is completely gutted: ABI-visible structures
retain the function pointers, but they never get called, and all the
open-coded conditionals throughout the DIX layer to implement BS are gone.

Note that this is still not a strictly complete implementation of backing
store, since Composite will throw the bits away on unmap and therefore
WhenMapped and Always hints are equivalent.
2007-08-25 15:08:20 -04:00
Matthieu Herrb
3305d17195 Fix indentation. 2007-08-23 22:48:19 +02:00
Matthieu Herrb
a66c0f1dca Remove an extra cast.
Thou should not apply patches manually without testing.
2007-08-23 22:11:56 +02:00
Otto Moerbeek
12d27cf33c A high resolution device that's moving fast can potentially generate
an int overflow, making dx*dx+dy*dy negative. Now pow(negative,
non-integer) yields NaN, so you loose.  Use fp math to avoid that.
2007-08-23 21:59:25 +02:00
Peter Hutterer
88a9828ef9 dix: Only check device events for possible ACLs.
We shouldn't be able to restrict events like Expose, etc. with device based
ACLs. So we just ignore all non-input events when checking for permissions.
2007-08-23 18:02:10 +09:30
Peter Hutterer
2c1431a76e dix: ProcChangeActivePointerGrab: make sure variable is initialised.
Thanks to Ben Close for spotting it.
2007-08-20 10:06:13 +09:30
Eamon Walsh
860a09cfb8 devPrivates rework: Nevermind, can't const due to return value warnings.
This reverts commit 6fd0a0b08d.
2007-08-16 16:12:01 -04:00
Eamon Walsh
6fd0a0b08d devPrivates rework: add const qualifier to key type. 2007-08-16 16:01:42 -04:00
Eamon Walsh
b2b7817497 devPrivates rework: use camelcase standard for name of key type. 2007-08-16 15:33:58 -04:00
Eamon Walsh
0a994d4f85 xace: add hooks + new access codes: core protocol selection requests 2007-08-16 12:54:35 -04:00
Eamon Walsh
3ef2e9e623 xace: add hooks + new access codes: core protocol pixmap requests 2007-08-16 12:27:48 -04:00
Eamon Walsh
fe9bc481ef xace: add hooks + new access codes: core protocol font requests 2007-08-16 12:19:49 -04:00
Eamon Walsh
e89301c879 xace: add hooks + new access codes: core protocol client requests 2007-08-16 10:57:49 -04:00
Eamon Walsh
b82557c9fb xace: add hooks + new access codes: core protocol screensaver requests 2007-08-16 10:36:05 -04:00
Eamon Walsh
568ae737d1 xace: add hooks + new access codes: core protocol server requests 2007-08-16 10:33:58 -04:00