Commit Graph

260 Commits

Author SHA1 Message Date
Peter Hutterer
6ab311c92d dix: Call RealizeCursor during InitializeSprite.
RealizeCursor should be called when the cursor is allocated. However, when the
root cursor is allocated, no devices exist yet, and thus RealizeCursor is
never called. This may lead to segfaults lateron in DDXes like Xnest that
actually need to do something for each cursor, and lateron rely on that
DDX-specific data for each cursor has been initialized.
2008-06-11 17:24:19 +09:30
Peter Hutterer
45b661c67a dix: Fix build with --disable-xinerama #16204
X.Org Bug 16204 <http://bugs.freedesktop.org/show_bug.cgi?id=16204>
2008-06-04 13:39:39 +09:30
Peter Hutterer
942086fc96 dix: ProcQueryPointer doesn't need special grab handling, PickPointer does it 2008-05-31 18:17:49 +09:30
Peter Hutterer
1d0438de17 Xi: remove RemoveOtherCoreGrabs()
PickPointer() returns grabbed devices, so we can't get a double grab anyway.
2008-04-25 16:28:58 +09:30
Peter Hutterer
b093bf3ec3 dix: don't search for grabbed devices, PickPointer does it for us now.
Follow-up to 93ee338307.
2008-04-25 15:15:31 +09:30
Peter Hutterer
6198bad07e dix: remove misleading (stale) comment 2008-04-25 15:02:44 +09:30
Peter Hutterer
93ee338307 dix: let PickPointer() return devices that are core-grabbed by the client.
If the client currently holds a core grab on any device, this device has
priority, even over the ClientPointer.
2008-04-25 15:02:08 +09:30
Peter Hutterer
c3659cb414 dix: always send FocusIn events if mode is NotifyUngrab.
In the case of a NotifyUngrab, the flag for the device may already be set but
we still need to send the FocusIn event.
2008-04-23 14:22:21 +09:30
Peter Hutterer
8190ef8754 Merge branch 'master' into mpx
Conflicts:

	Xext/EVI.c
	Xext/appgroup.c
	Xext/cup.c
	Xext/mitmisc.c
	Xext/sampleEVI.c
	dix/window.c
2008-04-22 18:04:05 +09:30
Peter Hutterer
1a9d7205cd Merge whot@wombat:~/potoroo/xserver into mpx 2008-04-14 16:25:58 +09:30
Peter Hutterer
755f9e5d78 dix: Ignore focus for passive grabs if the event is a pointer event. 2008-04-13 16:59:53 +09:30
Peter Hutterer
90f491cf8e Merge whot@wombat:~/potoroo/xserver into mpx 2008-04-11 08:29:52 +09:30
Peter Hutterer
04dff74ffd dix: Rework Enter/Leave semaphore system.
Instead of a simple counter, use bits to keep track of which device is where
etc. When device enters a window (or sets focus), the bit matching the device
is set, when it leaves again, it is unset. If there are 0 bits set, then
Leave/Enter/Focus events may be sent to the client.

Same theory as before, but this should get around the insanity with
Grab/Ungrab special cases. Those cases are basically untested though.
2008-04-10 19:22:59 +09:30
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
Jeremy Huddleston
3f51f493b6 XQuartz: Fix issue where clicking on an X11 window might send that event to an X11 window in another space.
(cherry picked from commit df21312c8b)
(cherry picked from commit 2d4194a8d1)
2008-04-08 17:03:18 -07:00
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
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
1692dcf197 dix: print out event type if a bogus pointer event occurs. 2008-01-30 13:04:58 +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