diff options
author | Kristian Høgsberg <krh@redhat.com> | 2009-09-18 22:09:03 -0400 |
---|---|---|
committer | Kristian Høgsberg <krh@bitplanet.net> | 2012-03-27 09:31:53 -0400 |
commit | 8e87102a87417955b34fc0062d945b9497756551 (patch) | |
tree | 1e8a90f46030bc0e244e9e9ed6e59572e1d05c3c | |
parent | f1d40ffa540a2e2d2339a872a8ad0a2ec9bcb656 (diff) |
Add redirect window for input device feature
-rw-r--r-- | Xi/exevents.c | 8 | ||||
-rw-r--r-- | dix/events.c | 10 | ||||
-rw-r--r-- | include/dix.h | 2 | ||||
-rw-r--r-- | include/exevents.h | 4 | ||||
-rw-r--r-- | include/inputstr.h | 2 |
5 files changed, 24 insertions, 2 deletions
diff --git a/Xi/exevents.c b/Xi/exevents.c index f390f6739..aa47d14c5 100644 --- a/Xi/exevents.c +++ b/Xi/exevents.c @@ -1913,6 +1913,14 @@ DeliverTouchEvents(DeviceIntPtr dev, TouchPointInfoPtr ti, if (ti->emulate_pointer) UpdateDeviceState(dev, &ev->device_event); + +void +SetDeviceRedirectWindow(DeviceIntPtr dev, WindowPtr window) +{ + SpritePtr pSprite = dev->spriteInfo->sprite; + + pSprite->redirectWindow = window; + CheckMotion(NULL, dev->u.master); } int diff --git a/dix/events.c b/dix/events.c index 924479582..d938354fc 100644 --- a/dix/events.c +++ b/dix/events.c @@ -2849,7 +2849,15 @@ XYToWindow(SpritePtr pSprite, int x, int y) BoxRec box; pSprite->spriteTraceGood = 1; /* root window still there */ - pWin = RootWindow(pSprite)->firstChild; + if (pSprite->redirectWindow == PointerRootWin) { + return RootWindow(pSprite); + } else if (pSprite->redirectWindow) { + pWin = pSprite->redirectWindow; + pSprite->spriteTrace[pSprite->spriteTraceGood++] = pWin; + pWin = pWin->firstChild; + } else + pWin = RootWindow(pSprite)->firstChild; + while (pWin) { if ((pWin->mapped) && diff --git a/include/dix.h b/include/dix.h index f3f68d39c..481ffa7b2 100644 --- a/include/dix.h +++ b/include/dix.h @@ -454,7 +454,7 @@ extern void DoFocusEvents( WindowPtr /* toWin */, int /* mode */); -extern int SetInputFocus( +extern _X_EXPORT int SetInputFocus( ClientPtr /* client */, DeviceIntPtr /* dev */, Window /* focusID */, diff --git a/include/exevents.h b/include/exevents.h index fb2ef274c..b813df49f 100644 --- a/include/exevents.h +++ b/include/exevents.h @@ -180,6 +180,10 @@ ProcessOtherEvent ( InternalEvent* /* ev */, DeviceIntPtr /* other */); +extern _X_EXPORT void SetDeviceRedirectWindow ( + DeviceIntPtr /* dev */, + WindowPtr /* window */); + extern void DeviceFocusEvent( DeviceIntPtr /* dev */, diff --git a/include/inputstr.h b/include/inputstr.h index 86db811fc..bd11ee596 100644 --- a/include/inputstr.h +++ b/include/inputstr.h @@ -248,6 +248,8 @@ typedef struct _SpriteRec { ScreenPtr pEnqueueScreen; ScreenPtr pDequeueScreen; + WindowPtr redirectWindow; + } SpriteRec; typedef struct _KeyClassRec { |