summaryrefslogtreecommitdiffstats
path: root/example.c
diff options
context:
space:
mode:
authordscho <dscho>2001-09-24 22:02:28 +0000
committerdscho <dscho>2001-09-24 22:02:28 +0000
commit5c438e3fb2d98f6aa36b58610ed9d871a41cf6f1 (patch)
tree32384646ca0bfcd2240ef1152fb605934b17da56 /example.c
parentfa85c12aa9f552aeafca4099467439d4cf434b79 (diff)
downloadlibtdevnc-5c438e3fb2d98f6aa36b58610ed9d871a41cf6f1.tar.gz
libtdevnc-5c438e3fb2d98f6aa36b58610ed9d871a41cf6f1.zip
bugfix: cursor (works now without xcursor encoding)
Diffstat (limited to 'example.c')
-rw-r--r--example.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/example.c b/example.c
index 1f53bd9..3c4f0a4 100644
--- a/example.c
+++ b/example.c
@@ -28,9 +28,10 @@
#endif
#define XK_MISCELLANY
#include "rfb.h"
-#include "keysymdef.h"
+#include "keysym.h"
const int maxx=640, maxy=480, bpp=4;
+/* TODO: odd maxx doesn't work */
/* This initializes a nice (?) background */
@@ -94,10 +95,10 @@ void drawline(unsigned char* buffer,int rowstride,int bpp,int x1,int y1,int x2,i
void doptr(int buttonMask,int x,int y,rfbClientPtr cl)
{
ClientData* cd=cl->clientData;
- //if(cl->screen->cursorIsDrawn)
- //rfbUndrawCursor(cl);
- //cl->screen->cursorX=x;
- //cl->screen->cursorY=y;
+ if(cl->screen->cursorIsDrawn)
+ rfbUndrawCursor(cl);
+ cl->screen->cursorX=x;
+ cl->screen->cursorY=y;
if(x>=0 && y>=0 && x<maxx && y<maxy) {
if(buttonMask) {
int i,j,x1,x2,y1,y2;
@@ -252,6 +253,7 @@ int main(int argc,char** argv)
rfbCursorPtr c = rfbScreen->cursor;
char x[32*32],mask[32*32/8];
c=rfbScreen->cursor = rfbMakeXCursor(w,h,x,mask);
+ c->xhot = 2; c->yhot = 10;
c->mask[0]=0xff; c->mask[1]=0x0;
memset(c->mask,255,h*w/8);
c->richSource = malloc(w*h*bpp);