Commit Graph

653 Commits

Author SHA1 Message Date
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
Eamon Walsh
3c9553ac2c xace: rename hostlist security hook to "server" as this hook will be used
for other types of server access besides just the host list.
2007-08-15 14:14:25 -04:00
Eamon Walsh
dc84bb3418 xace: add hooks + new access codes: core protocol cursor requests 2007-08-15 14:13:53 -04:00
Eamon Walsh
b424e01ec5 xace: add hooks + new access codes: core protocol property requests 2007-08-15 14:13:27 -04:00
Peter Hutterer
14d0397cde dix: ProcUngrabKeyboard: make sure grab is initialized.
This should fix the random segfaults with ProcUngrabKeyboard.

Thanks to David Nolden for spotting it.
2007-08-15 22:12:29 +09:30
Eamon Walsh
42d6112ec2 xace: add hooks + new access codes: core protocol GC requests 2007-08-14 13:09:38 -04:00
Eamon Walsh
9a183d7ba5 dix: remove caching of drawables and graphics contexts. The security checks
simply bypass the cached values so they are unused.
2007-08-14 11:39:26 -04:00
Eamon Walsh
2763056ab5 xace: add hooks + new access codes: core protocol window requests 2007-08-13 13:44:33 -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
Peter Hutterer
b1272eefd9 Fix typo from last commit. Oh well. 2007-08-08 15:00:02 +09:30
Peter Hutterer
c02128532e dix: Allow flexible devices for passive core grabs.
A passive core grab doesn't specify the device, and is thus created with the
ClientPointer as device.  When this grab is activated later, don't actually
activate the grab on the grab device, but rather change the device to the one
that caused the grab to activate. Same procedure for keyboards.

Makes core apps _A LOT_ more useable and reduces the need to set the
ClientPointer.

Only applies to core grabs!
2007-08-08 13:10:00 +09:30
Peter Hutterer
b8abeaf74e dix: get the paired keyboard for a passive grab (ProcGrabButton).
Taking the VCK is only correct if no physical device is connected, and even
then it's not really a good idea.
2007-08-07 12:32:46 +09:30
Peter Hutterer
a0b87f87fb dix: check for core event to determine if grab is a core grab (CreateGrab).
Checking for VCP/VCK is simply not a safe way to check if a grab is a core grab.
2007-08-07 10:49:33 +09:30
Eamon Walsh
d744df32a1 xace: add hooks + new access codes: core protocol colormap requests 2007-08-06 12:23:21 -04:00
Eamon Walsh
d445d2f22b security: drop the "declare extension security" dix call. Use the
SecurityPolicy configuration file instead.
2007-08-03 10:56:18 -04:00
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
1ace9770fe Build system: Non-dtrace distcheck hacks
automake 1.10 really wants foo.c for foo.O, so give it some dummy files to
deal with if it really needs them.
2007-08-01 08:10:38 +03:00
Daniel Stone
6b055e5d97 Input: Fix stuck modifiers (bug #11683)
Disclaimer: It's 6:51am.  I'm trying to be as understandable as possible.

What was happening previously was this:
 * Press Alt
 * Extended event generated and processed: state is now Alt down once
 * Core event generated
   - keyboard switched: inherited state is Alt down once
   - event processed: Alt down twice
 * Release Alt
 * Extended event generated and processed: state is now null
 * Core event generated and processed: Alt down once

If we switch the order:
 * Press Alt
 * Core event generated:
  - keyboard switched: inherited state is null
  - event processed: Alt down once
 * Extended event generated and processed: state is now Alt down once
 * Release Alt
 * Core event generated and processed: state is now null
 * Extended event generated and processed: state is now null

When we carry over the previous state, it needs to be the _previous_ state
(state and modifiersPerKey), assuming that we're going to catch now-core
events for any of these.  For example, if Ctrl is held down as we pivot, we
need to carry Ctrl over with a count of one, for which an extended + core
release will then clear.  Carrying over the union of the previous state _and
the state resulting from the immediate action_ was what broke things.
2007-08-01 06:55:36 +03:00
Daniel Stone
1150969b82 Convert all my license statements to the standard form
Convert all my license statements to the standard, accepted form:
cf. <20070717142307.GD13478@fooishbar.org>
    http://lists.freedesktop.org/archives/xorg/2007-July/026451.html

keithp's license on configure.ac changed with his verbal permission.
2007-08-01 01:53:31 +03: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
Daniel Stone
4d238c5c67 Input: GetPointerEvents: Deny events from devices without valuators
For some reason, my keyboard has 25 mouse buttons, but zero valuators.  This
causes GPE to blow up spectacularly, trying to get (and set) co-ordinates from
devices without valuators.  For now, just prevent this from ever happening,
and whack a dirty great FIXME in.
2007-08-01 01:53:31 +03:00
Daniel Stone
0afeb0241a DIX: Clean up null root cursor handling
Move the null root cursor handling out of main() and into CreateRootCursor.
2007-08-01 01:53:31 +03:00
Daniel Stone
4d3379d418 Fonts: Fix builtin fonts
Make sure the font path is always 'built-ins' when we use built-in fonts,
rather than having it as a fixed path for a while, then clobbering it
halfway through startup.
2007-08-01 01:53:31 +03:00
Daniel Stone
1cdadc2f43 Hotplug: Separate D-Bus into core and hotplug API components
Break up D-Bus into two components: a D-Bus core that can be used by any
part of the server (for the moment, just the D-Bus hotplug API, and the
forthcoming HAL hotplug API), and the old D-Bus hotplug API.
2007-08-01 01:53:31 +03:00
Adam Jackson
7da38bb6a1 Partial redundancy elimination in PropertyNotify generation. 2007-07-21 15:27:40 -04:00
Peter Hutterer
ffdf8f3e45 DeliverEventsToWindow: ensure that genericMask has a defined value. 2007-07-10 19:11:30 +09:30
Peter Hutterer
9809715afa Change CheckMotion to ignore non-pointer events but acknowledge XI events.
Call CheckMotion from ProcessOtherEvents() to make sure absolute XI events
update the sprite before an event is sent.
2007-07-10 10:09:50 +09:30
Peter Hutterer
62efc3951a DeliverGrabbedEvent: stop segfault when gemask == NULL. 2007-07-10 10:09:44 +09:30
Peter Hutterer
3312e4dd5e Call CheckMotion for all core events.
We need to do this to update the sprites x/y coordinate before we assemble a
button event. Absolute devices may send a buttonEvent with valuators attached.
If we don't update the sprite before assembling the event, the valuators are
lost and the button press is delivered to the previous position of the device.
Doesn't have any effect on relative devices.
2007-07-10 10:09:37 +09:30
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
Keith Packard
866f092ca0 Make Composite manual redirect windows not clip their parent.
This patch changes the semantics of manual redirect windows so that they no
longer affect the clip list of their parent. Doing this means the parent can
draw to the area covered by the child without using IncludeInferiors. More
importantly, this also means that the parent receives expose events when
that region is damaged by other actions.
2007-07-03 14:29:11 -07:00
Peter Hutterer
c1a16bdcfe Add 'evfill' field to GEExtensions.
We need this to allow extensions to fill in extra data for an event before it
is sent to the client. This is probably to be used like
FillUpEventsFromWindow().
2007-07-01 09:14:18 +09:30
Adam Jackson
4d76075dbb Death to RCS tags. 2007-06-29 14:06:52 -04:00
Peter Hutterer
2691c05fd6 Make sure window->optional is allocated before assigning it.
DeletePassiveGrabFromList() may remove the window optional, so we need to
re-alloc it if it isn't there anymore.

Thanks to Colin Harrison for spotting the bug.
2007-06-29 11:56:18 +09:30
Tiago Vignatti
d73835efda More janitor work. Remove 'defined but not used' warnings from kdrive and some minor cosmetic. 2007-06-27 03:34:13 -03:00
Peter Hutterer
08779c62ba Reset grab->next to NULL when we're creating a grab.
This is definitely necessary in CheckDeviceGrabAndHintWindow (thanks to Paulo
Zanoni for spotting it). We're resetting it everywhere else too, just to be
save.
2007-06-27 11:58:20 +09:30
Peter Hutterer
8396bf7c8b Init genericMasks to 0, make sure list is NULL terminated. 2007-06-27 11:58:04 +09:30
Peter Hutterer
8e5102b9f0 Set the detail field for DeviceKeyEvents to the keycode.
(cherry picked from commit 0c33dc152e)
2007-06-25 09:35:31 +09:30
Peter Hutterer
87564543d9 Only decrement buttonsDown when the button count is greater than 0.
Device drivers flush their buttons on device init and cause a button down
event to be generated. If we unconditionally decrease the buttons, we won't be
able to ever get a passive device grab.

Format documentation for CheckDeviceGrabs to make it readable.
(cherry picked from commit 3e894974cd)

Conflicts:

	Xi/exevents.c
2007-06-25 09:35:30 +09:30
Peter Hutterer
24ee89fd60 Add a few comments to devices.c 2007-06-25 09:35:30 +09:30
Peter Hutterer
b141b85c25 Check for identical grabs when adding a new passive grab. If an identical grab
exists, remove the old one and prepend the new one.

X.org Bug 2738 <https://bugs.freedesktop.org/show_bug.cgi?id=2738>
2007-06-25 09:35:30 +09:30
Peter Hutterer
0c33dc152e Set the detail field for DeviceKeyEvents to the keycode. 2007-06-21 17:42: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
Peter Hutterer
3e894974cd Only decrement buttonsDown when the button count is greater than 0.
Device drivers flush their buttons on device init and cause a button down
event to be generated. If we unconditionally decrease the buttons, we won't be
able to ever get a passive device grab.

Format documentation for CheckDeviceGrabs to make it readable.
2007-06-15 17:16:16 +09:30
Peter Hutterer
0aaf515466 Zero deviceMask and genericMask when creating a grab via CreateGrab(). 2007-06-12 16:55:26 +09:30
Eamon Walsh
e2a720c9a1 Merge branch 'master' into XACE-SELINUX
Conflicts:

	dix/dixutils.c
2007-06-11 15:29:11 -04:00
Michel Dänzer
644f7ddc0c dixLookupClient: Use access parameter. 2007-06-11 09:23:18 +02:00
Adam Jackson
dfbe32b5b8 Remove the old Kerberos 5 authentication code.
Before you complain, this code hasn't seen material change since at least
X11R6.  It certainly does not build with any modern version of Kerberos.
Anybody wanting krb5 auth to their X server should probably be using
GSSAPI instead of internal krb5 API anyway.
2007-06-04 18:07:00 -04:00
Eamon Walsh
793470a835 dix: fix null pointer dereference in new resource lookup function. 2007-06-04 12:33:49 -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
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
182ab3a3d5 Fix up comments for event.c 2007-05-30 17:44:31 +09:30
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
Luo Jie
1f48995d66 Fix build of composite, dix, and randr when Xinerama is disabled. 2007-05-24 11:20:59 -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
d0e8f47409 Change GrabDevice's parameter name back to "coreGrab".
Was changed during a global search/replace for
5c680e9493.

Otherwise people like me introduce bugs (e.g. in
333bab4b23)
2007-05-21 13:06:21 +09:30
Peter Hutterer
0b4db74922 Squish the flags into the upper bits of the mode field for EnterLeave events.
This way we have enough space for the detail field.
2007-05-17 18:00:07 +09:30
Peter Hutterer
333bab4b23 Clean up, correct some comments.
Send event type down with the RawEvents.
2007-05-17 17:59:02 +09:30
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
Soren Sandmann Pedersen
dde0ceac4e Add new InitRegions() function called from dix/main 2007-05-15 11:13:15 -04:00
Peter Hutterer
a8c56372ba Revert "Allow events to grabWindows event if the device is not grabbed."
This reverts commit 339b73e710.
Allowing those events can lead to race conditions.

Conflicts:

	dix/events.c
2007-05-15 10:24:22 +09:30
Peter Hutterer
81fc6a128b Add ungrab support to ExtendedGrabDeviceRequest handling.
Polish the code a bit.
2007-05-14 18:12:56 +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
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
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
11d0e2109b Correct enterleave semaphore value for root window. 2007-05-01 14:16:36 +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
5e43910929 Add GenericEvent extension to Xext.
This adds (unconditional) support for the GE extension. Anything from now on
that sends events in MPX will have to use the GE extension. No GE, no MPX
events. GE is not actually used yet from anywhere with this commit.

You will need to update x11proto, xextproto, libX11, libXext and xcb to the
matching xge branches. Things will _NOT_ work without the updated protocol
headers and libraries.
2007-04-30 12:57:42 +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
Peter Hutterer
339b73e710 Allow events to grabWindows event if the device is not grabbed.
This kinda makes popup windows useable if the WM doesn't set the
ClientPointer. Kinda.
2007-04-27 13:24:27 +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
b6aec7f6f9 Change FocusIn/Out semantics to match Enter/Leave semantics. 2007-04-17 16:51:16 +09:30
Peter Hutterer
451d5464b4 Change enter/leave semantics for events with detail Notify{Nonlinear}Virtual.
Core enter/leave events with detail Notify{Ancestor|Inferior|Nonlinear} are
only sent for the first/last pointer to enter/leave. Events with detail
Notify{Nonlinear}Virtual are sent at all times, but not to those windows that
currently have one or more pointers inside their boundaries.
2007-04-17 11:17:04 +09:30
Peter Hutterer
ea27b09d3a Deliver FocusIn/FocusOut events for all devices.
Don't use VCK in SetInputFocus and DeliverFocusedEvent.
2007-04-13 17:15:22 +09:30
Peter Hutterer
7ccebc50b9 Documentation for events.c. 2007-04-13 13:08:44 +09:30
Peter Hutterer
2bb3c81fc1 Use paired kbd instead of VCK for EnterLeaveEvents, sanitize variable naming. 2007-04-12 16:35:43 +09:30
Peter Hutterer
e7b47b1758 Change core enter/leave semantics for multiple pointers.
Send EnterNotify when first device enters the window, LeaveNotify when the
last device leaves the window. Additional devices will not cause additional
Enter/LeaveNotifies.
2007-04-12 16:24:42 +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
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
Daniel Stone
e92743bc98 getevents: Copy modifier state from extended to core devices
Make core events carry the same modifier state as the extended events, so
that holding down Ctrl on keyboard A and pressing Q on keyboard B won't
cause your app to quit.
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
ed75b05651 dix: add new, combined resource lookup function. Move all dix lookup API
deprecated so far to a new file dix/deprecated.c.  Remove the deprecation
warnings for the time being.
2007-04-04 16:00:15 -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
676188531b Unrealize cursor only once, not per device. 2007-04-04 17:35:06 +09:30
Eamon Walsh
14aea12cad xace: forgot one of the hook call arguments. Add it. 2007-04-03 15:23:56 -04:00