diff options
Diffstat (limited to 'recordmydesktop')
-rw-r--r-- | recordmydesktop/src/rmd.c | 2 | ||||
-rw-r--r-- | recordmydesktop/src/rmd_initialize_data.c | 9 | ||||
-rw-r--r-- | recordmydesktop/src/rmd_make_dummy_pointer.c | 28 | ||||
-rw-r--r-- | recordmydesktop/src/rmd_make_dummy_pointer.h | 3 | ||||
-rw-r--r-- | recordmydesktop/src/rmd_types.h | 2 |
5 files changed, 23 insertions, 21 deletions
diff --git a/recordmydesktop/src/rmd.c b/recordmydesktop/src/rmd.c index 92e247f..bb513a2 100644 --- a/recordmydesktop/src/rmd.c +++ b/recordmydesktop/src/rmd.c @@ -84,8 +84,6 @@ int main(int argc,char **argv){ pdata.specs.visual = DefaultVisual(pdata.dpy, pdata.specs.screen); pdata.specs.gc = DefaultGC(pdata.dpy, pdata.specs.screen); pdata.specs.depth = DefaultDepth(pdata.dpy, pdata.specs.screen); - pdata.specs.bpixel = XBlackPixel(pdata.dpy, pdata.specs.screen); - pdata.specs.wpixel = XWhitePixel(pdata.dpy, pdata.specs.screen); if((pdata.specs.depth!=32)&& (pdata.specs.depth!=24)&& diff --git a/recordmydesktop/src/rmd_initialize_data.c b/recordmydesktop/src/rmd_initialize_data.c index 32bd529..631e725 100644 --- a/recordmydesktop/src/rmd_initialize_data.c +++ b/recordmydesktop/src/rmd_initialize_data.c @@ -63,9 +63,12 @@ int InitializeData(ProgData *pdata, fprintf(stderr,"Initializing...\n"); MakeMatrices(); if(pdata->args.have_dummy_cursor){ - pdata->dummy_pointer=MakeDummyPointer(&pdata->specs,16, - pdata->args.cursor_color,0, - &pdata->npxl); + pdata->dummy_pointer = MakeDummyPointer(pdata->dpy, + &pdata->specs, + 16, + pdata->args.cursor_color, + 0, + &pdata->npxl); pdata->dummy_p_size=16; } else diff --git a/recordmydesktop/src/rmd_make_dummy_pointer.c b/recordmydesktop/src/rmd_make_dummy_pointer.c index e49178e..7b409cf 100644 --- a/recordmydesktop/src/rmd_make_dummy_pointer.c +++ b/recordmydesktop/src/rmd_make_dummy_pointer.c @@ -26,17 +26,22 @@ #include "config.h" +#include <X11/Xlib.h> + #include "rmd_types.h" #include "rmd_macro.h" #include "rmd_make_dummy_pointer.h" -unsigned char *MakeDummyPointer(DisplaySpecs *specs, +unsigned char *MakeDummyPointer(Display *display, + DisplaySpecs *specs, int size, int color, int type, unsigned char *npxl){ + unsigned long bpixel = XBlackPixel(display, specs->screen); + unsigned long wpixel = XWhitePixel(display, specs->screen); int i,k,o='.'; unsigned long b=(color)?'w':'b', w=(color)?'b':'w'; @@ -59,18 +64,15 @@ unsigned char *MakeDummyPointer(DisplaySpecs *specs, {o,o,o,o,o,o,w,w,o,o,o,o,o,o,o,o}} }; unsigned char *ret=malloc(size*sizeof(char[size*4])); - unsigned char wp[4]={ - ((specs->wpixel^0xff000000)>>24), - ((specs->wpixel^0x00ff0000)>>16), - ((specs->wpixel^0x0000ff00)>>8), - ((specs->wpixel^0x000000ff)) - }; - unsigned char bp[4]={ - ((specs->bpixel^0xff000000)>>24), - ((specs->bpixel^0x00ff0000)>>16), - ((specs->bpixel^0x0000ff00)>>8), - ((specs->bpixel^0x000000ff)) - }; + unsigned char wp[4]={ (wpixel ^ 0xff000000) >> 24, + (wpixel ^ 0x00ff0000) >> 16, + (wpixel ^ 0x0000ff00) >> 8, + (wpixel ^ 0x000000ff) }; + unsigned char bp[4]={ (bpixel ^ 0xff000000) >> 24, + (bpixel ^ 0x00ff0000) >> 16, + (bpixel ^ 0x0000ff00) >> 8, + (bpixel ^ 0x000000ff) }; + *npxl=((wp[0]-1)!=bp[0])?wp[0]-100:wp[0]-102; for(i=0;i<size;i++){ for(k=0;k<size;k++){ diff --git a/recordmydesktop/src/rmd_make_dummy_pointer.h b/recordmydesktop/src/rmd_make_dummy_pointer.h index c0aa144..cd7a9a0 100644 --- a/recordmydesktop/src/rmd_make_dummy_pointer.h +++ b/recordmydesktop/src/rmd_make_dummy_pointer.h @@ -48,7 +48,8 @@ * * \returns Pointer to pixel data of the cursor */ -unsigned char *MakeDummyPointer(DisplaySpecs *specs, +unsigned char *MakeDummyPointer(Display *display, + DisplaySpecs *specs, int size, int color, int type, diff --git a/recordmydesktop/src/rmd_types.h b/recordmydesktop/src/rmd_types.h index 2af06b2..89271b8 100644 --- a/recordmydesktop/src/rmd_types.h +++ b/recordmydesktop/src/rmd_types.h @@ -86,8 +86,6 @@ typedef struct _DisplaySpecs{ //this struct holds some basic information Visual *visual; GC gc; int depth; - unsigned long bpixel; - unsigned long wpixel; }DisplaySpecs; typedef struct _WGeometry{ //basic geometry of a window or area |