diff options
Diffstat (limited to 'dix')
-rw-r--r-- | dix/dispatch.c | 6 | ||||
-rw-r--r-- | dix/events.c | 37 | ||||
-rw-r--r-- | dix/window.c | 13 |
3 files changed, 42 insertions, 14 deletions
diff --git a/dix/dispatch.c b/dix/dispatch.c index 6a93dacbb..bad17beaf 100644 --- a/dix/dispatch.c +++ b/dix/dispatch.c @@ -1249,6 +1249,12 @@ ProcTranslateCoords(register ClientPtr client) && (!wBoundingShape(pWin) || POINT_IN_REGION(pWin->drawable.pScreen, &pWin->borderSize, x, y, &box)) + + && (!wInputShape(pWin) || + POINT_IN_REGION(pWin->drawable.pScreen, + wInputShape(pWin), + x - pWin->drawable.x, + y - pWin->drawable.y, &box)) #endif ) { diff --git a/dix/events.c b/dix/events.c index fcd6eec29..29fe78924 100644 --- a/dix/events.c +++ b/dix/events.c @@ -1988,26 +1988,32 @@ static WindowPtr XYToWindow(int x, int y) { register WindowPtr pWin; + BoxRec box; spriteTraceGood = 1; /* root window still there */ pWin = ROOT->firstChild; 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)) + (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)) + /* 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) || + POINT_IN_REGION(pWin->drawable.pScreen, + wInputShape(pWin), + x - pWin->drawable.x, + y - pWin->drawable.y, &box)) #endif - ) + ) { if (spriteTraceGood >= spriteTraceSize) { @@ -2277,7 +2283,12 @@ XineramaPointInWindowIsVisible( x = xoff - panoramiXdataPtr[i].x; y = yoff - panoramiXdataPtr[i].y; - if(POINT_IN_REGION(pScreen, &pWin->borderClip, x, y, &box)) + if(POINT_IN_REGION(pScreen, &pWin->borderClip, x, y, &box) + && (!wInputShape(pWin) || + POINT_IN_REGION(pWin->drawable.pScreen, + wInputShape(pWin), + x - pWin->drawable.x, + y - pWin->drawable.y, &box))) return TRUE; } diff --git a/dix/window.c b/dix/window.c index 27d3d05ec..ac6f775ba 100644 --- a/dix/window.c +++ b/dix/window.c @@ -414,6 +414,7 @@ CreateRootWindow(ScreenPtr pScreen) #ifdef SHAPE pWin->optional->boundingShape = NULL; pWin->optional->clipShape = NULL; + pWin->optional->inputShape = NULL; #endif #ifdef XINPUT pWin->optional->inputMasks = NULL; @@ -800,6 +801,8 @@ FreeWindowResources(register WindowPtr pWin) REGION_DESTROY(pScreen, wBoundingShape (pWin)); if (wClipShape (pWin)) REGION_DESTROY(pScreen, wClipShape (pWin)); + if (wInputShape (pWin)) + REGION_DESTROY(pScreen, wInputShape (pWin)); #endif if (pWin->borderIsPixel == FALSE) (*pScreen->DestroyPixmap)(pWin->border.pixmap); @@ -3182,7 +3185,12 @@ PointInWindowIsVisible(register WindowPtr pWin, int x, int y) if (!pWin->realized) return (FALSE); if (POINT_IN_REGION(pWin->drawable.pScreen, &pWin->borderClip, - x, y, &box)) + x, y, &box) + && (!wInputShape(pWin) || + POINT_IN_REGION(pWin->drawable.pScreen, + wInputShape(pWin), + x - pWin->drawable.x, + y - pWin->drawable.y, &box))) return(TRUE); return(FALSE); } @@ -3558,6 +3566,8 @@ CheckWindowOptionalNeed (register WindowPtr w) return; if (optional->clipShape != NULL) return; + if (optional->inputShape != NULL) + return; #endif #ifdef XINPUT if (optional->inputMasks != NULL) @@ -3603,6 +3613,7 @@ MakeWindowOptional (register WindowPtr pWin) #ifdef SHAPE optional->boundingShape = NULL; optional->clipShape = NULL; + optional->inputShape = NULL; #endif #ifdef XINPUT optional->inputMasks = NULL; |