dix: remove now unused "exclude" parameter from FirstPointerChild

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer 2008-12-18 15:43:18 +10:00
parent 0aa4460c3b
commit 72ad4a85cc

View File

@ -73,13 +73,12 @@ HasPointer(WindowPtr win)
/** /**
* Search for the first window below @win that has a pointer directly within * Search for the first window below @win that has a pointer directly within
* it's boundaries (excluding boundaries of its own descendants). * it's boundaries (excluding boundaries of its own descendants).
* Windows including @exclude and its descendants are ignored.
* *
* @return The child window that has the pointer within its boundaries or * @return The child window that has the pointer within its boundaries or
* NULL. * NULL.
*/ */
static WindowPtr static WindowPtr
FirstPointerChild(WindowPtr win, WindowPtr exclude) FirstPointerChild(WindowPtr win)
{ {
static WindowPtr *queue = NULL; static WindowPtr *queue = NULL;
static int queue_size = 256; /* allocated size of queue */ static int queue_size = 256; /* allocated size of queue */
@ -88,7 +87,7 @@ FirstPointerChild(WindowPtr win, WindowPtr exclude)
int queue_len = 0; /* no of elements in queue */ int queue_len = 0; /* no of elements in queue */
int queue_head = 0; /* pos of current element */ int queue_head = 0; /* pos of current element */
if (!win || win == exclude || !win->firstChild) if (!win || !win->firstChild)
return NULL; return NULL;
if (!queue && !(queue = xcalloc(queue_size, sizeof(WindowPtr)))) if (!queue && !(queue = xcalloc(queue_size, sizeof(WindowPtr))))
@ -100,12 +99,6 @@ FirstPointerChild(WindowPtr win, WindowPtr exclude)
while (queue_len--) while (queue_len--)
{ {
if (queue[queue_head] == exclude)
{
queue_head = (queue_head + 1) % queue_size;
continue;
}
if (queue[queue_head] != win && HasPointer(queue[queue_head])) if (queue[queue_head] != win && HasPointer(queue[queue_head]))
return queue[queue_head]; return queue[queue_head];
@ -236,7 +229,7 @@ CoreEnterNotifies(DeviceIntPtr dev,
may need to be changed from Virtual to NonlinearVirtual depending may need to be changed from Virtual to NonlinearVirtual depending
on the previous P(W). */ on the previous P(W). */
if (!HasPointer(parent) && !FirstPointerChild(parent, None)) if (!HasPointer(parent) && !FirstPointerChild(parent))
CoreEnterLeaveEvent(dev, EnterNotify, mode, detail, parent, CoreEnterLeaveEvent(dev, EnterNotify, mode, detail, parent,
child->drawable.id); child->drawable.id);
} }
@ -275,7 +268,7 @@ CoreLeaveNotifies(DeviceIntPtr dev,
/* If one window has a pointer or a child with a pointer, skip some /* If one window has a pointer or a child with a pointer, skip some
* work and exit. */ * work and exit. */
if (HasPointer(win) || FirstPointerChild(win, None)) if (HasPointer(win) || FirstPointerChild(win))
return; return;
CoreEnterLeaveEvent(dev, LeaveNotify, mode, detail, win, child->drawable.id); CoreEnterLeaveEvent(dev, LeaveNotify, mode, detail, win, child->drawable.id);
@ -340,7 +333,7 @@ CoreEnterLeaveNonLinear(DeviceIntPtr dev,
if (!HasPointer(A)) if (!HasPointer(A))
{ {
WindowPtr child = FirstPointerChild(A, None); WindowPtr child = FirstPointerChild(A);
if (child) if (child)
CoreEnterLeaveEvent(dev, LeaveNotify, mode, NotifyInferior, A, None); CoreEnterLeaveEvent(dev, LeaveNotify, mode, NotifyInferior, A, None);
else else
@ -384,7 +377,7 @@ CoreEnterLeaveNonLinear(DeviceIntPtr dev,
if (!HasPointer(B)) if (!HasPointer(B))
{ {
WindowPtr child = FirstPointerChild(B, None); WindowPtr child = FirstPointerChild(B);
if (child) if (child)
CoreEnterLeaveEvent(dev, EnterNotify, mode, NotifyInferior, B, None); CoreEnterLeaveEvent(dev, EnterNotify, mode, NotifyInferior, B, None);
else else
@ -422,7 +415,7 @@ CoreEnterLeaveToAncestor(DeviceIntPtr dev,
*/ */
if (!HasPointer(A)) if (!HasPointer(A))
{ {
WindowPtr child = FirstPointerChild(A, None); WindowPtr child = FirstPointerChild(A);
if (child) if (child)
CoreEnterLeaveEvent(dev, LeaveNotify, mode, NotifyInferior, A, None); CoreEnterLeaveEvent(dev, LeaveNotify, mode, NotifyInferior, A, None);
else else
@ -498,7 +491,7 @@ CoreEnterLeaveToDescendant(DeviceIntPtr dev,
if (!HasPointer(B)) if (!HasPointer(B))
{ {
WindowPtr child = FirstPointerChild(B, None); WindowPtr child = FirstPointerChild(B);
if (child) if (child)
CoreEnterLeaveEvent(dev, EnterNotify, mode, NotifyInferior, B, None); CoreEnterLeaveEvent(dev, EnterNotify, mode, NotifyInferior, B, None);
else else