[PATCH 07/21] dix: deduplicate callers of DeliverDeviceEvents in DeliverGrabbedEvents

Peter Hutterer peter.hutterer at who-t.net
Thu Dec 8 19:36:08 PST 2011


No functional change.

Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 dix/events.c |   18 ++++++++++--------
 1 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/dix/events.c b/dix/events.c
index 37039c6..6e015fe 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -4156,6 +4156,7 @@ DeliverGrabbedEvent(InternalEvent *event, DeviceIntPtr thisDev,
     if (grab->ownerEvents)
     {
 	WindowPtr focus;
+	WindowPtr win;
 
         /* 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
@@ -4172,15 +4173,16 @@ DeliverGrabbedEvent(InternalEvent *event, DeviceIntPtr thisDev,
 	else
 	    focus = PointerRootWin;
 	if (focus == PointerRootWin)
-	    deliveries = DeliverDeviceEvents(pSprite->win, event, grab,
-                                             NullWindow, thisDev);
-	else if (focus && (focus == pSprite->win ||
-                    IsParent(focus, pSprite->win)))
-	    deliveries = DeliverDeviceEvents(pSprite->win, event, grab, focus,
-					     thisDev);
+	{
+	    win = pSprite->win;
+	    focus = NullWindow;
+	} else if (focus && (focus == pSprite->win ||
+		    IsParent(focus, pSprite->win)))
+	    win = pSprite->win;
 	else if (focus)
-	    deliveries = DeliverDeviceEvents(focus, event, grab, focus,
-					     thisDev);
+	    win = focus;
+
+	deliveries = DeliverDeviceEvents(win, event, grab, focus, thisDev);
     }
     if (!deliveries)
     {
-- 
1.7.7.1



More information about the xorg-devel mailing list