Commit Graph

244 Commits

Author SHA1 Message Date
Peter Hutterer
a88386ee27 Xi: only DeliverFocusedEvents if the event is not a pointer event.
A pointer device may have a focus class, but even if so, pointer events must
be delivered to the sprite window, not the focus window.
2008-04-10 14:42:26 +09:30
Peter Hutterer
bce6091c6b dix: Extend IsKeyboardDevice() to not include pointer devices.
If a pointer devices has key classes as well, don't register it as a keyboard
device. Let's see how much that change will break.
2008-04-10 09:59:45 +09:30
Peter Hutterer
cc7dab2d04 dix: Dont deliver grabbed pointer events to a focus window.
If an pointer event is being processed during a device grab, don't deliver it
to the focus window, even if the device has a focus class. Reason being that
some pointers may have a focus class, thus killing drag-and-drop.
2008-04-10 09:58:50 +09:30
Peter Hutterer
638a50552e dix: remove debug error message about XI->core type conversion. 2008-04-06 08:36:21 +09:30
Peter Hutterer
27b2127893 Xi: remove ungrab handling of ExtendedUngrabDevice request.
This can be done by UngrabDevice, no need for separate codepaths.
2008-02-25 17:00:42 +10:30
Peter Hutterer
77dba004a9 dix: add InputEventListLen and SetMinimumEventSize
The latter is used to increase the amount of allocated memory for the event
list. This will be needed for ClassesChangedEvents that can be of more or less
arbitrary size (larger than 32 anyway).
2008-02-19 15:52:35 +10:30
Peter Hutterer
3fe64d8d27 Move input event list initialisation and storage from DDX to DIX.
Rather than letting the DDX allocate the events, allocate them once in the DIX
and just pass it around when needed.

DDX should call GetEventList() to obtain this list and then pass it into
Get{Pointer|Keyboard}Events.
2008-02-18 18:46:01 +10:30
Peter Hutterer
379f057646 Xext: add GEDeviceMaskIsSet (GE mask checking per device)
If a mask was set for the NULL device, then we pretend the mask is set for all
devices.
2008-01-25 10:27:26 +10:30
Peter Hutterer
6492d513c0 dix: if a client has a core grab, return the grab device on QueryPointer.
The correct thing would be to return the ClientPointer. However, if the client
for some reason has a core grab on another device (e.g. as result of a passive
grab), return the coordinates of the grabbed device instead.

This makes the use of nautilus a bit saner.
2008-01-18 21:44:22 +10:30
Peter Hutterer
cd2ad4c2ed dix: remove some superfluous lines in ProcChangeActivePointerGrab. 2008-01-18 20:11:55 +10:30
Peter Hutterer
8a925d201e dix: free the genericMasks when ungrabbing.
This finally plugs a memory hole created by grabs registering for generic
events.
2008-01-18 20:07:20 +10:30
Peter Hutterer
d323fd6420 dix: remove inputInfo.pointer refernce in EventSelectForWindow
If the window being changed is set as the motion hint window for any device,
the device's motion hint window is set to NULL. Which is kinda what the old
code did, except that it did it with only the VCP.
2008-01-18 19:18:07 +10:30
Peter Hutterer
883811c2be dix: remove inputInfo.pointer reference in TryClientEvents.
Unfortunately, this requires a change in the TCE API, and thus a change in all
callers. Tough luck.
2008-01-18 18:48:46 +10:30
Peter Hutterer
b0bf4308ac dix: print out an error when core type can't be converted.
Helps a bit in tracking down bugs.
2008-01-15 19:15:09 +10:30
Peter Hutterer
32aa252e98 dix: Process an input event as a single event, instead of two separate ones.
This is a significant shift in how input events are perceived. The common
approach was to treat a core event as a different entity than the XI event.
This could result in the XI event being delivered to a different client than
the core event. This doesn't work nicely if they come from the same device.

Instead, we treat an input event as a single event, that is delivered through
two separate APIs. So when delivering an event, we first try the XI event,
then the core event. If the window want's neither, we go to the parent and
repeat. Once either core or XI has been delivered, the processing stops.

Important: Different to the previous method, if a client registers for core
button events, the parent window will not get XI events. This should only
cause problems when you're mixing core and XI events, so don't do that!

Generic events don't fit into this yet, they cause me headaches.
2008-01-15 18:41:51 +10:30
Peter Hutterer
0969a9f749 dix: Emulate core events within CheckDeviceGrabs and ComputeFreezes.
This should restore the correct passive grab processing. When checking for
passive grabs, the core event is emulated and we check first for XI grabs on
the window, then for core grabs. Regardless of which event activates the grab,
the XI event is stored in the device's EQ.

When replaying the event, we take the XI event and replay it on the next
window, again including the emulation of the core event.
2008-01-15 11:31:12 +10:30
Peter Hutterer
a83a0c5a14 dix: remove obsolete comment.
Pairings don't exist anymore and the documented issue is a non-issue now.
2008-01-13 16:14:29 +10:30
Peter Hutterer
20ace6321a dix: don't try to confine cursor on screen restructure if there is no cursor.
Stops segfaulting when using xrandr. Yay.
2008-01-07 20:08:56 +10:30
Peter Hutterer
57a491e6d3 dix: init GrabPrivateKey to correct value.
Merge detritus from last pull.
2008-01-07 20:06:32 +10:30
Peter Hutterer
8da83836b6 Merge branch 'master' into mpx
Conflicts:

	XTrap/xtrapddmi.c
	Xext/security.c
	Xext/xprint.c
	Xext/xtest.c
	Xext/xvdisp.c
	Xi/exevents.c
	Xi/grabdevb.c
	Xi/grabdevk.c
	Xi/opendev.c
	Xi/ungrdev.c
	Xi/ungrdevb.c
	Xi/ungrdevk.c
	dix/cursor.c
	dix/devices.c
	dix/dixutils.c
	dix/events.c
	dix/getevents.c
	dix/main.c
	dix/window.c
	hw/xfree86/ramdac/xf86Cursor.c
	include/dix.h
	include/input.h
	include/inputstr.h
	mi/midispcur.c
	mi/miinitext.c
	mi/misprite.c
	render/animcur.c
	xfixes/cursor.c
	xkb/xkbAccessX.c
2008-01-03 17:04:54 +10:30
Peter Hutterer
d86e7f2ecc dix: when getting a bogus event, at least print out the type. 2007-12-11 17:49:16 +10:30
Peter Hutterer
447cd5d411 dix: update comments about inputInfo.pointer. 2007-12-04 19:09:37 +10:30
Peter Hutterer
f44d7dcb5f dix: change the filters to be per-device.
If we have one global filter, one pointer may change the filter value and
affect another pointer.

Reproduceable effect:
blackbox and xterm, start dragging xterm then click anywhere with the other
pointer (attached to different masterd device!).  The button release resets
the filter[Motion_Filter(button)] value, thus stopping dragging and no event
is sent to the client anymore.
Having the filters set per device gets around this.
2007-12-04 19:07:46 +10:30
Peter Hutterer
0931f40bf1 dix: comments, whitespaces, copyright fixes.
Removing my copyright message for now, should eventually be in line with the
rest of the messages.
2007-12-04 17:08:56 +10:30
Peter Hutterer
09c0c1a3cc dix: remove #ifdef XINPUT.
No escaping XINPUT anymore.
2007-12-04 16:51:52 +10:30
Peter Hutterer
9eb8ea9e61 dix: only freeze the paired MD on a grab, not all other devices. 2007-11-30 11:32:59 +10:30
Peter Hutterer
bf3198c8c5 dix: fix typo 2007-11-24 15:00:57 +10:30
Peter Hutterer
5dabe448bd dix: Add special treatment of NotifyUngrab for enter/leave events.
In some cases (e.g. using x2x) the previous model broke, with a window ending
not counting down to 0 anymore. Special treatment for NotifyUngrab seems to
help here.

Current solution: If a NotifyGrab is to be sent ignore it. If a NotifyUngrab
enter is sent, only adjust the semaphore if it is on 0. Likewise, do the same
for a NotifyUngrab leave if the semaphore is on 1. This seems to work alright
so far.
2007-11-24 15:00:43 +10:30
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
Adam Jackson
20fd478324 Small static cleanups on dix/ 2007-11-15 17:01:33 -05:00
Peter Hutterer
5031238aad dix: remove trailing/wrong whitespaces from devices.c and events.c 2007-11-13 16:58:23 +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
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
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
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
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
8c6923018c xace: Add a "manage" access check when setting the Redirect event bits. 2007-10-25 19:01:29 -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
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
Eamon Walsh
6107a24503 dix: Add client parameter to AddPassiveGrabsToList(). 2007-10-18 12:24:55 -04:00
Eamon Walsh
c3f7b86255 Merge branch 'master' into XACE-SELINUX
Conflicts:

	os/access.c
2007-10-17 15:00:54 -04:00
Peter Hutterer
b697c4ed14 dix: CheckPassiveGrabOnWindow: only get paired device for non-keyboards. 2007-10-16 17:47:06 +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
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
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