[vino] Fix the cursor bounds computation



commit b2cc3670b909fd1fd2e7f475b7cc39dfcc56ac63
Author: Fabrice Bellet <fabrice bellet info>
Date:   Tue May 8 00:49:54 2012 +0100

    Fix the cursor bounds computation
    
    See bug 492033.

 server/libvncserver/cursor.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/server/libvncserver/cursor.c b/server/libvncserver/cursor.c
index 5826f14..d4bb62e 100644
--- a/server/libvncserver/cursor.c
+++ b/server/libvncserver/cursor.c
@@ -393,18 +393,20 @@ rfbBool rfbGetCursorBounds(rfbScreenInfoPtr screen,
 	return FALSE;
 
    x1 = screen->cursorX - cursor->xhot;
+   x2 = x1 + cursor->width;
+
    if (x1 < 0)
        x1 = 0;
    
-   x2 = x1 + cursor->width;
    if (x2 >= screen->width)
        x2 = screen->width - 1;
    
    y1 = screen->cursorY - cursor->yhot;
+   y2 = y1 + cursor->height;
+
    if (y1 < 0)
        y1 = 0;
 
-   y2 = y1 + cursor->height;
    if (y2 >= screen->height)
        y2 = screen->height - 1;
 
@@ -483,7 +485,7 @@ void rfbDrawCursor(rfbScreenInfoPtr screen,
    if (screen->cursorX < cursor->xhot)
        i1 = cursor->xhot - screen->cursorX;
    if (screen->cursorY < cursor->yhot)
-       j1 = cursor->xhot - screen->cursorY;
+       j1 = cursor->yhot - screen->cursorY;
 
    /* save what is under the cursor */
    for (j = 0; j < (bounds->y2 - bounds->y1); j++)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]