diff options
author | dscho <dscho> | 2001-09-24 07:30:50 +0000 |
---|---|---|
committer | dscho <dscho> | 2001-09-24 07:30:50 +0000 |
commit | fa85c12aa9f552aeafca4099467439d4cf434b79 (patch) | |
tree | c17cbd30cbf8b62947be97fb7c2a4255adc2877f /main.c | |
parent | 1e83d9a5994e0e68497a136b719c9c1c53103f3c (diff) | |
download | libtdevnc-fa85c12aa9f552aeafca4099467439d4cf434b79.tar.gz libtdevnc-fa85c12aa9f552aeafca4099467439d4cf434b79.zip |
cursor changes
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 17 |
1 files changed, 13 insertions, 4 deletions
@@ -90,8 +90,8 @@ void rfbMarkRegionAsModified(rfbScreenInfoPtr rfbScreen,RegionPtr modRegion) void rfbMarkRectAsModified(rfbScreenInfoPtr rfbScreen,int x1,int y1,int x2,int y2) { - BoxRec box; - RegionRec region; + BoxRec box; //=(BoxRec*)malloc(sizeof(BoxRec)); + RegionRec* region=(RegionRec*)malloc(sizeof(RegionRec)); int i; if(x1>x2) { i=x1; x1=x2; x2=i; } x2++; @@ -104,8 +104,8 @@ void rfbMarkRectAsModified(rfbScreenInfoPtr rfbScreen,int x1,int y1,int x2,int y if(y2>=rfbScreen->height) { y2=rfbScreen->height-1; if(y1==y2) y1--; } box.x1=x1; box.y1=y1; box.x2=x2; box.y2=y2; - REGION_INIT(cl->screen,®ion,&box,0); - rfbMarkRegionAsModified(rfbScreen,®ion); + REGION_INIT(cl->screen,region,&box,0); + rfbMarkRegionAsModified(rfbScreen,region); } int rfbDeferUpdateTime = 40; /* ms */ @@ -298,6 +298,15 @@ defaultKbdAddEvent(Bool down, KeySym keySym, rfbClientPtr cl) void defaultPtrAddEvent(int buttonMask, int x, int y, rfbClientPtr cl) { + if(x!=cl->screen->cursorX || y!=cl->screen->cursorY) { + Bool cursorWasDrawn=cl->screen->cursorIsDrawn; + if(cursorWasDrawn) + rfbUndrawCursor(cl); + cl->screen->cursorX = x; + cl->screen->cursorY = y; + if(cursorWasDrawn) + rfbDrawCursor(cl); + } } void defaultSetXCutText(char* text, int len, rfbClientPtr cl) |