summaryrefslogtreecommitdiff
path: root/dix/events.c
diff options
context:
space:
mode:
authorPeter Hutterer <peter@cs.unisa.edu.au>2008-04-10 09:58:50 +0930
committerPeter Hutterer <peter@cs.unisa.edu.au>2008-04-10 09:58:50 +0930
commitcc7dab2d04da4ca164eeec1a3296df1706585466 (patch)
treeed51af0a685b2a7acb88463180931c98fa1a58ec /dix/events.c
parentdf2545b98d888924209cb889a68737c15f1aa209 (diff)
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.
Diffstat (limited to 'dix/events.c')
-rw-r--r--dix/events.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/dix/events.c b/dix/events.c
index 6ecd90c08..a2a0c1a67 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -3686,7 +3686,18 @@ DeliverGrabbedEvent(xEvent *xE, DeviceIntPtr thisDev,
{
WindowPtr focus;
- if (thisDev->focus)
+ /* Hack: Some pointer device have a focus class. So we need to check
+ * for the type of event, to see if we really want to deliver it to
+ * the focus window. For pointer events, the answer is no.
+ */
+ if (xE->u.u.type == DeviceButtonPress ||
+ xE->u.u.type == DeviceButtonRelease ||
+ xE->u.u.type == DeviceMotionNotify ||
+ xE->u.u.type == ProximityIn ||
+ xE->u.u.type == ProximityOut)
+ {
+ focus = PointerRootWin;
+ } else if (thisDev->focus)
{
focus = thisDev->focus->win;
if (focus == FollowKeyboardWin)