Use GetCurrentRootWindow or equivalent instead of spriteTrace[0].

Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Jamey Sharp 2010-08-04 13:48:33 -07:00 committed by Peter Hutterer
parent 32de0c1907
commit 8efa3623f3
3 changed files with 6 additions and 11 deletions

View File

@ -2430,7 +2430,7 @@ AttachDevice(ClientPtr client, DeviceIntPtr dev, DeviceIntPtr master)
WindowPtr currentRoot; WindowPtr currentRoot;
if (dev->spriteInfo->sprite) if (dev->spriteInfo->sprite)
currentRoot = dev->spriteInfo->sprite->spriteTrace[0]; currentRoot = GetCurrentRootWindow(dev);
else /* new device auto-set to floating */ else /* new device auto-set to floating */
currentRoot = screenInfo.screens[0]->root; currentRoot = screenInfo.screens[0]->root;

View File

@ -1251,11 +1251,6 @@ CoreFocusEvents(DeviceIntPtr dev,
SetFocusIn(dev, to); SetFocusIn(dev, to);
} }
/**
* The root window the given device is currently on.
*/
#define RootWindow(dev) dev->spriteInfo->sprite->spriteTrace[0]
static void static void
DeviceFocusEvents(DeviceIntPtr dev, DeviceFocusEvents(DeviceIntPtr dev,
WindowPtr from, WindowPtr from,
@ -1284,7 +1279,7 @@ DeviceFocusEvents(DeviceIntPtr dev,
if ((from == NullWindow) || (from == PointerRootWin)) if ((from == NullWindow) || (from == PointerRootWin))
{ {
if (from == PointerRootWin) if (from == PointerRootWin)
DeviceFocusOutEvents(dev, sprite->win, RootWindow(dev), mode, DeviceFocusOutEvents(dev, sprite->win, GetCurrentRootWindow(dev), mode,
NotifyPointer); NotifyPointer);
/* Notify all the roots */ /* Notify all the roots */
for (i = 0; i < nscreens; i++) for (i = 0; i < nscreens; i++)
@ -1304,19 +1299,19 @@ DeviceFocusEvents(DeviceIntPtr dev,
for (i = 0; i < nscreens; i++) for (i = 0; i < nscreens; i++)
DeviceFocusEvent(dev, XI_FocusIn, mode, in, screenInfo.screens[i]->root); DeviceFocusEvent(dev, XI_FocusIn, mode, in, screenInfo.screens[i]->root);
if (to == PointerRootWin) if (to == PointerRootWin)
DeviceFocusInEvents(dev, RootWindow(dev), sprite->win, mode, NotifyPointer); DeviceFocusInEvents(dev, GetCurrentRootWindow(dev), sprite->win, mode, NotifyPointer);
} }
else else
{ {
if ((from == NullWindow) || (from == PointerRootWin)) if ((from == NullWindow) || (from == PointerRootWin))
{ {
if (from == PointerRootWin) if (from == PointerRootWin)
DeviceFocusOutEvents(dev, sprite->win, RootWindow(dev), mode, DeviceFocusOutEvents(dev, sprite->win, GetCurrentRootWindow(dev), mode,
NotifyPointer); NotifyPointer);
for (i = 0; i < nscreens; i++) for (i = 0; i < nscreens; i++)
DeviceFocusEvent(dev, XI_FocusOut, mode, out, screenInfo.screens[i]->root); DeviceFocusEvent(dev, XI_FocusOut, mode, out, screenInfo.screens[i]->root);
if (to->parent != NullWindow) if (to->parent != NullWindow)
DeviceFocusInEvents(dev, RootWindow(dev), to, mode, NotifyNonlinearVirtual); DeviceFocusInEvents(dev, GetCurrentRootWindow(dev), to, mode, NotifyNonlinearVirtual);
DeviceFocusEvent(dev, XI_FocusIn, mode, NotifyNonlinear, to); DeviceFocusEvent(dev, XI_FocusIn, mode, NotifyNonlinear, to);
if (IsParent(to, sprite->win)) if (IsParent(to, sprite->win))
DeviceFocusInEvents(dev, to, sprite->win, mode, NotifyPointer); DeviceFocusInEvents(dev, to, sprite->win, mode, NotifyPointer);

View File

@ -5055,7 +5055,7 @@ ProcSendEvent(ClientPtr client)
/* If the input focus is PointerRootWin, send the event to where /* If the input focus is PointerRootWin, send the event to where
the pointer is if possible, then perhaps propogate up to root. */ the pointer is if possible, then perhaps propogate up to root. */
if (inputFocus == PointerRootWin) if (inputFocus == PointerRootWin)
inputFocus = pSprite->spriteTrace[0]; /* Root window! */ inputFocus = RootWindow(dev);
if (IsParent(inputFocus, pSprite->win)) if (IsParent(inputFocus, pSprite->win))
{ {