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.
This commit is contained in:
Peter Hutterer 2008-04-10 09:58:50 +09:30
parent df2545b98d
commit cc7dab2d04
1 changed files with 12 additions and 1 deletions

View File

@ -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)