diff options
Diffstat (limited to 'xorg-server/dix/dispatch.c')
-rw-r--r-- | xorg-server/dix/dispatch.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/xorg-server/dix/dispatch.c b/xorg-server/dix/dispatch.c index b305e68e1..16fe27246 100644 --- a/xorg-server/dix/dispatch.c +++ b/xorg-server/dix/dispatch.c @@ -2070,6 +2070,14 @@ DoGetImage(ClientPtr client, int format, Drawable drawable, if (!pWin->viewable) return BadMatch; + /* If the drawable is a window, the rectangle must be contained within + * its bounds (including the border). */ + if (x < -wBorderWidth(pWin) || + x + width > wBorderWidth(pWin) + (int)pDraw->width || + y < -wBorderWidth(pWin) || + y + height > wBorderWidth(pWin) + (int)pDraw->height) + return BadMatch; + relx += pDraw->x; rely += pDraw->y; @@ -3939,6 +3947,8 @@ AddScreen( return -1; } + update_desktop_dimensions(); + dixRegisterScreenPrivateKey(&cursorScreenDevPriv, pScreen, PRIVATE_CURSOR, 0); return i; |