dix: rename IsParent() to WindowIsParent()
Spending it a more fitting name. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
parent
abcd627d40
commit
6fc8b593a4
|
@ -2930,7 +2930,7 @@ SendEvent(ClientPtr client, DeviceIntPtr d, Window dest, Bool propagate,
|
|||
if (inputFocus == PointerRootWin)
|
||||
inputFocus = InputDevCurrentRootWindow(d);
|
||||
|
||||
if (IsParent(inputFocus, spriteWin)) {
|
||||
if (WindowIsParent(inputFocus, spriteWin)) {
|
||||
effectiveFocus = inputFocus;
|
||||
pWin = spriteWin;
|
||||
}
|
||||
|
|
|
@ -551,7 +551,7 @@ int OtherClientGone(void *value, XID id);
|
|||
* @param child the alleged child
|
||||
* @return TRUE if `child` is a child window of `parent`
|
||||
*/
|
||||
Bool IsParent(WindowPtr parent, WindowPtr child)
|
||||
Bool WindowIsParent(WindowPtr parent, WindowPtr child)
|
||||
_X_ATTRIBUTE_NONNULL_ARG(1,2);
|
||||
|
||||
#endif /* _XSERVER_DIX_PRIV_H */
|
||||
|
|
|
@ -144,7 +144,7 @@ FirstPointerChild(WindowPtr win)
|
|||
int i;
|
||||
|
||||
for (i = 0; i < MAXDEVICES; i++) {
|
||||
if (PointerWindows[i] && IsParent(win, PointerWindows[i]))
|
||||
if (PointerWindows[i] && WindowIsParent(win, PointerWindows[i]))
|
||||
return PointerWindows[i];
|
||||
}
|
||||
|
||||
|
@ -165,7 +165,7 @@ FirstFocusChild(WindowPtr win)
|
|||
|
||||
for (i = 0; i < MAXDEVICES; i++) {
|
||||
if (FocusWindows[i] && FocusWindows[i] != PointerRootWin &&
|
||||
IsParent(win, FocusWindows[i]))
|
||||
WindowIsParent(win, FocusWindows[i]))
|
||||
return FocusWindows[i];
|
||||
}
|
||||
|
||||
|
@ -219,7 +219,7 @@ static WindowPtr
|
|||
CommonAncestor(WindowPtr a, WindowPtr b)
|
||||
{
|
||||
for (b = b->parent; b; b = b->parent)
|
||||
if (IsParent(b, a))
|
||||
if (WindowIsParent(b, a))
|
||||
return b;
|
||||
return NullWindow;
|
||||
}
|
||||
|
@ -545,9 +545,9 @@ CoreEnterLeaveEvents(DeviceIntPtr dev, WindowPtr from, WindowPtr to, int mode)
|
|||
|
||||
LeaveWindow(dev);
|
||||
|
||||
if (IsParent(from, to))
|
||||
if (WindowIsParent(from, to))
|
||||
CoreEnterLeaveToDescendant(dev, from, to, mode);
|
||||
else if (IsParent(to, from))
|
||||
else if (WindowIsParent(to, from))
|
||||
CoreEnterLeaveToAncestor(dev, from, to, mode);
|
||||
else
|
||||
CoreEnterLeaveNonLinear(dev, from, to, mode);
|
||||
|
@ -559,14 +559,14 @@ static void
|
|||
DeviceEnterLeaveEvents(DeviceIntPtr dev,
|
||||
int sourceid, WindowPtr from, WindowPtr to, int mode)
|
||||
{
|
||||
if (IsParent(from, to)) {
|
||||
if (WindowIsParent(from, to)) {
|
||||
DeviceEnterLeaveEvent(dev, sourceid, XI_Leave, mode, NotifyInferior,
|
||||
from, None);
|
||||
DeviceEnterNotifies(dev, sourceid, from, to, mode, NotifyVirtual);
|
||||
DeviceEnterLeaveEvent(dev, sourceid, XI_Enter, mode, NotifyAncestor, to,
|
||||
None);
|
||||
}
|
||||
else if (IsParent(to, from)) {
|
||||
else if (WindowIsParent(to, from)) {
|
||||
DeviceEnterLeaveEvent(dev, sourceid, XI_Leave, mode, NotifyAncestor,
|
||||
from, None);
|
||||
DeviceLeaveNotifies(dev, sourceid, from, to, mode, NotifyVirtual);
|
||||
|
@ -966,12 +966,12 @@ CoreFocusOutNotifyPointerEvents(DeviceIntPtr dev,
|
|||
|
||||
if (!P)
|
||||
return;
|
||||
if (!IsParent(pwin_parent, P))
|
||||
if (!WindowIsParent(pwin_parent, P))
|
||||
if (!(pwin_parent == P && inclusive))
|
||||
return;
|
||||
|
||||
if (exclude != None && exclude != PointerRootWin &&
|
||||
(IsParent(exclude, P) || IsParent(P, exclude)))
|
||||
(WindowIsParent(exclude, P) || WindowIsParent(P, exclude)))
|
||||
return;
|
||||
|
||||
stopAt = (inclusive) ? pwin_parent->parent : pwin_parent;
|
||||
|
@ -1013,10 +1013,10 @@ CoreFocusInNotifyPointerEvents(DeviceIntPtr dev,
|
|||
|
||||
P = PointerWin(GetMaster(dev, POINTER_OR_FLOAT));
|
||||
|
||||
if (!P || P == exclude || (pwin_parent != P && !IsParent(pwin_parent, P)))
|
||||
if (!P || P == exclude || (pwin_parent != P && !WindowIsParent(pwin_parent, P)))
|
||||
return;
|
||||
|
||||
if (exclude != None && (IsParent(exclude, P) || IsParent(P, exclude)))
|
||||
if (exclude != None && (WindowIsParent(exclude, P) || WindowIsParent(P, exclude)))
|
||||
return;
|
||||
|
||||
CoreFocusInRecurse(dev, P, pwin_parent, mode, inclusive);
|
||||
|
@ -1268,7 +1268,7 @@ CoreFocusPointerRootNoneSwitch(DeviceIntPtr dev,
|
|||
B != PointerRootWin) {
|
||||
WindowPtr ptrwin = PointerWin(GetMaster(dev, POINTER_OR_FLOAT));
|
||||
|
||||
if (ptrwin && IsParent(root, ptrwin))
|
||||
if (ptrwin && WindowIsParent(root, ptrwin))
|
||||
CoreFocusOutNotifyPointerEvents(dev, root, None, mode,
|
||||
TRUE);
|
||||
}
|
||||
|
@ -1408,9 +1408,9 @@ CoreFocusEvents(DeviceIntPtr dev, WindowPtr from, WindowPtr to, int mode)
|
|||
CoreFocusToPointerRootOrNone(dev, from, to, mode);
|
||||
else if ((from == NullWindow) || (from == PointerRootWin))
|
||||
CoreFocusFromPointerRootOrNone(dev, from, to, mode);
|
||||
else if (IsParent(from, to))
|
||||
else if (WindowIsParent(from, to))
|
||||
CoreFocusToDescendant(dev, from, to, mode);
|
||||
else if (IsParent(to, from))
|
||||
else if (WindowIsParent(to, from))
|
||||
CoreFocusToAncestor(dev, from, to, mode);
|
||||
else
|
||||
CoreFocusNonLinear(dev, from, to, mode);
|
||||
|
@ -1453,7 +1453,7 @@ DeviceFocusEvents(DeviceIntPtr dev, WindowPtr from, WindowPtr to, int mode)
|
|||
screenInfo.screens[i]->root);
|
||||
}
|
||||
else {
|
||||
if (IsParent(from, sprite->win)) {
|
||||
if (WindowIsParent(from, sprite->win)) {
|
||||
DeviceFocusEvent(dev, XI_FocusOut, mode, NotifyPointer,
|
||||
sprite->win);
|
||||
DeviceFocusOutEvents(dev, sprite->win, from, mode,
|
||||
|
@ -1490,26 +1490,26 @@ DeviceFocusEvents(DeviceIntPtr dev, WindowPtr from, WindowPtr to, int mode)
|
|||
DeviceFocusInEvents(dev, InputDevCurrentRootWindow(dev), to, mode,
|
||||
NotifyNonlinearVirtual);
|
||||
DeviceFocusEvent(dev, XI_FocusIn, mode, NotifyNonlinear, to);
|
||||
if (IsParent(to, sprite->win))
|
||||
if (WindowIsParent(to, sprite->win))
|
||||
DeviceFocusInEvents(dev, to, sprite->win, mode, NotifyPointer);
|
||||
}
|
||||
else {
|
||||
if (IsParent(to, from)) {
|
||||
if (WindowIsParent(to, from)) {
|
||||
DeviceFocusEvent(dev, XI_FocusOut, mode, NotifyAncestor, from);
|
||||
DeviceFocusOutEvents(dev, from, to, mode, NotifyVirtual);
|
||||
DeviceFocusEvent(dev, XI_FocusIn, mode, NotifyInferior, to);
|
||||
if ((IsParent(to, sprite->win)) &&
|
||||
if ((WindowIsParent(to, sprite->win)) &&
|
||||
(sprite->win != from) &&
|
||||
(!IsParent(from, sprite->win)) &&
|
||||
(!IsParent(sprite->win, from)))
|
||||
(!WindowIsParent(from, sprite->win)) &&
|
||||
(!WindowIsParent(sprite->win, from)))
|
||||
DeviceFocusInEvents(dev, to, sprite->win, mode,
|
||||
NotifyPointer);
|
||||
}
|
||||
else if (IsParent(from, to)) {
|
||||
if ((IsParent(from, sprite->win)) &&
|
||||
else if (WindowIsParent(from, to)) {
|
||||
if ((WindowIsParent(from, sprite->win)) &&
|
||||
(sprite->win != from) &&
|
||||
(!IsParent(to, sprite->win)) &&
|
||||
(!IsParent(sprite->win, to))) {
|
||||
(!WindowIsParent(to, sprite->win)) &&
|
||||
(!WindowIsParent(sprite->win, to))) {
|
||||
DeviceFocusEvent(dev, XI_FocusOut, mode, NotifyPointer,
|
||||
sprite->win);
|
||||
DeviceFocusOutEvents(dev, sprite->win, from, mode,
|
||||
|
@ -1524,7 +1524,7 @@ DeviceFocusEvents(DeviceIntPtr dev, WindowPtr from, WindowPtr to, int mode)
|
|||
WindowPtr common = CommonAncestor(to, from);
|
||||
|
||||
/* common == NullWindow ==> different screens */
|
||||
if (IsParent(from, sprite->win))
|
||||
if (WindowIsParent(from, sprite->win))
|
||||
DeviceFocusOutEvents(dev, sprite->win, from, mode,
|
||||
NotifyPointer);
|
||||
DeviceFocusEvent(dev, XI_FocusOut, mode, NotifyNonlinear, from);
|
||||
|
@ -1535,7 +1535,7 @@ DeviceFocusEvents(DeviceIntPtr dev, WindowPtr from, WindowPtr to, int mode)
|
|||
DeviceFocusInEvents(dev, common, to, mode,
|
||||
NotifyNonlinearVirtual);
|
||||
DeviceFocusEvent(dev, XI_FocusIn, mode, NotifyNonlinear, to);
|
||||
if (IsParent(to, sprite->win))
|
||||
if (WindowIsParent(to, sprite->win))
|
||||
DeviceFocusInEvents(dev, to, sprite->win, mode,
|
||||
NotifyPointer);
|
||||
}
|
||||
|
|
20
dix/events.c
20
dix/events.c
|
@ -967,7 +967,7 @@ ChangeToCursor(DeviceIntPtr pDev, CursorPtr cursor)
|
|||
* @returns true if b is a descendent of a
|
||||
*/
|
||||
Bool
|
||||
IsParent(WindowPtr a, WindowPtr b)
|
||||
WindowIsParent(WindowPtr a, WindowPtr b)
|
||||
{
|
||||
for (b = b->parent; b; b = b->parent)
|
||||
if (b == a)
|
||||
|
@ -995,7 +995,7 @@ PostNewCursor(DeviceIntPtr pDev)
|
|||
ChangeToCursor(pDev, grab->cursor);
|
||||
return;
|
||||
}
|
||||
if (IsParent(grab->window, pSprite->win))
|
||||
if (WindowIsParent(grab->window, pSprite->win))
|
||||
win = pSprite->win;
|
||||
else
|
||||
win = grab->window;
|
||||
|
@ -3066,7 +3066,7 @@ ActivateFocusInGrab(DeviceIntPtr dev, WindowPtr old, WindowPtr win)
|
|||
if (!dev->deviceGrab.fromPassiveGrab ||
|
||||
dev->deviceGrab.grab->type != XI_FocusIn ||
|
||||
dev->deviceGrab.grab->window == win ||
|
||||
IsParent(dev->deviceGrab.grab->window, win))
|
||||
WindowIsParent(dev->deviceGrab.grab->window, win))
|
||||
return FALSE;
|
||||
DoEnterLeaveEvents(dev, dev->id, old, win, XINotifyPassiveUngrab);
|
||||
(*dev->deviceGrab.DeactivateGrab) (dev);
|
||||
|
@ -3107,7 +3107,7 @@ ActivateEnterGrab(DeviceIntPtr dev, WindowPtr old, WindowPtr win)
|
|||
if (!dev->deviceGrab.fromPassiveGrab ||
|
||||
dev->deviceGrab.grab->type != XI_Enter ||
|
||||
dev->deviceGrab.grab->window == win ||
|
||||
IsParent(dev->deviceGrab.grab->window, win))
|
||||
WindowIsParent(dev->deviceGrab.grab->window, win))
|
||||
return FALSE;
|
||||
DoEnterLeaveEvents(dev, dev->id, old, win, XINotifyPassiveUngrab);
|
||||
(*dev->deviceGrab.DeactivateGrab) (dev);
|
||||
|
@ -4208,7 +4208,7 @@ DeliverFocusedEvent(DeviceIntPtr keybd, InternalEvent *event, WindowPtr window)
|
|||
DeliverDeviceEvents(window, event, NullGrab, NullWindow, keybd);
|
||||
return;
|
||||
}
|
||||
if ((focus == window) || IsParent(focus, window)) {
|
||||
if ((focus == window) || WindowIsParent(focus, window)) {
|
||||
if (DeliverDeviceEvents(window, event, NullGrab, focus, keybd))
|
||||
return;
|
||||
}
|
||||
|
@ -4382,7 +4382,7 @@ DeliverGrabbedEvent(InternalEvent *event, DeviceIntPtr thisDev,
|
|||
deliveries = DeliverDeviceEvents(pSprite->win, event, grab,
|
||||
NullWindow, thisDev);
|
||||
else if (focus && (focus == pSprite->win ||
|
||||
IsParent(focus, pSprite->win)))
|
||||
WindowIsParent(focus, pSprite->win)))
|
||||
deliveries = DeliverDeviceEvents(pSprite->win, event, grab, focus,
|
||||
thisDev);
|
||||
else if (focus)
|
||||
|
@ -4704,7 +4704,7 @@ CoreEnterLeaveEvent(DeviceIntPtr mouse,
|
|||
event.u.enterLeave.mode = mode;
|
||||
focus = (keybd) ? keybd->focus->win : None;
|
||||
if ((focus != NoneWin) &&
|
||||
((pWin == focus) || (focus == PointerRootWin) || IsParent(focus, pWin)))
|
||||
((pWin == focus) || (focus == PointerRootWin) || WindowIsParent(focus, pWin)))
|
||||
event.u.enterLeave.flags |= ELFlagFocus;
|
||||
|
||||
if ((mask & GetEventFilter(mouse, &event))) {
|
||||
|
@ -4788,7 +4788,7 @@ DeviceEnterLeaveEvent(DeviceIntPtr mouse,
|
|||
|
||||
focus = (kbd) ? kbd->focus->win : None;
|
||||
if ((focus != NoneWin) &&
|
||||
((pWin == focus) || (focus == PointerRootWin) || IsParent(focus, pWin)))
|
||||
((pWin == focus) || (focus == PointerRootWin) || WindowIsParent(focus, pWin)))
|
||||
event->focus = TRUE;
|
||||
|
||||
FixUpEventFromWindow(mouse->spriteInfo->sprite, (xEvent *) event, pWin,
|
||||
|
@ -5531,7 +5531,7 @@ ProcSendEvent(ClientPtr client)
|
|||
if (inputFocus == PointerRootWin)
|
||||
inputFocus = InputDevCurrentRootWindow(dev);
|
||||
|
||||
if (IsParent(inputFocus, pSprite->win)) {
|
||||
if (WindowIsParent(inputFocus, pSprite->win)) {
|
||||
effectiveFocus = inputFocus;
|
||||
pWin = pSprite->win;
|
||||
}
|
||||
|
@ -5952,7 +5952,7 @@ CheckCursorConfinement(WindowPtr pWin)
|
|||
if (grab && (confineTo = grab->confineTo)) {
|
||||
if (!BorderSizeNotEmpty(pDev, confineTo))
|
||||
(*pDev->deviceGrab.DeactivateGrab) (pDev);
|
||||
else if ((pWin == confineTo) || IsParent(pWin, confineTo))
|
||||
else if ((pWin == confineTo) || WindowIsParent(pWin, confineTo))
|
||||
ConfineCursorToWindow(pDev, confineTo, TRUE, TRUE);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3252,7 +3252,7 @@ sprite_check_lost_focus(SpritePtr sprite, WindowPtr window)
|
|||
if (xwl_seat->focus_window == NULL &&
|
||||
xwl_seat->last_focus_window != NULL &&
|
||||
(xwl_seat->last_focus_window->toplevel == window ||
|
||||
IsParent(xwl_seat->last_focus_window->toplevel, window)))
|
||||
WindowIsParent(xwl_seat->last_focus_window->toplevel, window)))
|
||||
return TRUE;
|
||||
|
||||
return FALSE;
|
||||
|
|
Loading…
Reference in New Issue