diff options
author | Ulrich Sibiller <uli42@gmx.de> | 2019-10-28 17:45:49 +0100 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2019-11-01 16:36:24 +0100 |
commit | 6ed435e44765f83287dfe14129ba1d74bfcb9fde (patch) | |
tree | dd775d6219f0479522b58909509cf33ea609c1d2 /nx-X11/programs/Xserver/hw | |
parent | f887d428c4443c2df31e831e6b1a3eec23a03aeb (diff) | |
download | nx-libs-6ed435e44765f83287dfe14129ba1d74bfcb9fde.tar.gz nx-libs-6ed435e44765f83287dfe14129ba1d74bfcb9fde.tar.bz2 nx-libs-6ed435e44765f83287dfe14129ba1d74bfcb9fde.zip |
NXevents.c: use XYToWindow from dix
add a callback to determine the starting window.
Diffstat (limited to 'nx-X11/programs/Xserver/hw')
-rw-r--r-- | nx-X11/programs/Xserver/hw/nxagent/NXevents.c | 58 |
1 files changed, 8 insertions, 50 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXevents.c b/nx-X11/programs/Xserver/hw/nxagent/NXevents.c index 606b5e3b8..6754991c9 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXevents.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXevents.c @@ -135,6 +135,7 @@ of the copyright holder. #include <nx-X11/Xlib.h> +#define XYWINDOWCALLBACK #include "../../dix/events.c" #include "compext/Compext.h" @@ -251,15 +252,14 @@ ProcAllowEvents(register ClientPtr client) return Success; } +/* + * called from XYToWindow to determine where XYToWindow() should start + * going through the list. + */ + static WindowPtr -XYToWindow(int x, int y) +GetXYStartWindow(WindowPtr pWin) { - register WindowPtr pWin; - BoxRec box; - - spriteTraceGood = 1; /* root window still there */ - -#ifdef NXAGENT_SERVER if (nxagentOption(Rootless)) { if (nxagentLastEnteredWindow == NULL) @@ -274,49 +274,7 @@ XYToWindow(int x, int y) pWin = pWin->prevSib; } } - else - { - pWin = ROOT->firstChild; - } -#else - pWin = ROOT->firstChild; -#endif - while (pWin) - { - if ((pWin->mapped) && - (x >= pWin->drawable.x - wBorderWidth (pWin)) && - (x < pWin->drawable.x + (int)pWin->drawable.width + - wBorderWidth(pWin)) && - (y >= pWin->drawable.y - wBorderWidth (pWin)) && - (y < pWin->drawable.y + (int)pWin->drawable.height + - wBorderWidth (pWin)) -#ifdef SHAPE - /* When a window is shaped, a further check - * is made to see if the point is inside - * borderSize - */ - && (!wBoundingShape(pWin) || PointInBorderSize(pWin, x, y)) - && (!wInputShape(pWin) || - RegionContainsPoint( - wInputShape(pWin), - x - pWin->drawable.x, - y - pWin->drawable.y, &box)) -#endif - ) - { - if (spriteTraceGood >= spriteTraceSize) - { - spriteTraceSize += 10; - spriteTrace = realloc( - spriteTrace, spriteTraceSize*sizeof(WindowPtr)); - } - spriteTrace[spriteTraceGood++] = pWin; - pWin = pWin->firstChild; - } - else - pWin = pWin->nextSib; - } - return spriteTrace[spriteTraceGood-1]; + return pWin; } static Bool |