From be180f9385ffb3459525db309fe009b6f76906ad Mon Sep 17 00:00:00 2001 From: iovar Date: Fri, 15 Sep 2006 18:03:41 +0000 Subject: v0.2.5, xfixes cursor git-svn-id: https://recordmydesktop.svn.sourceforge.net/svnroot/recordmydesktop/trunk@47 f606c939-3180-4ac9-a4b8-4b8779d57d0a --- recordmydesktop/src/get_frame.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'recordmydesktop/src/get_frame.c') diff --git a/recordmydesktop/src/get_frame.c b/recordmydesktop/src/get_frame.c index 81ca392..ff935c0 100644 --- a/recordmydesktop/src/get_frame.c +++ b/recordmydesktop/src/get_frame.c @@ -34,6 +34,7 @@ void *GetFrame(void *pdata){ WGeometry mouse_pos_abs,mouse_pos_rel,mouse_pos_temp; Window root_ret,child_ret; int pixel_total=((ProgData *)pdata)->brwin.rgeom.width*((ProgData *)pdata)->brwin.rgeom.height; + XFixesCursorImage *xcim=NULL; mouse_pos_abs.x=0; mouse_pos_abs.y=0; @@ -72,6 +73,21 @@ void *GetFrame(void *pdata){ // } } } + if(((ProgData *)pdata)->args.xfixes_cursor){ + //xfixes pointer sequence + //update previous_position + //(if full_shots is enabled this is skipped since it's pointless) + if(!((ProgData *)pdata)->args.full_shots){ + CLIP_DUMMY_POINTER_AREA(mouse_pos_abs,&((ProgData *)pdata)->brwin,&mouse_pos_temp); + if((mouse_pos_temp.x>=0)&&(mouse_pos_temp.y>=0)&&(mouse_pos_temp.width>0)&&(mouse_pos_temp.height>0)) + RectInsert(&((ProgData *)pdata)->rect_root[tlist_sel],&mouse_pos_temp); + } + xcim=XFixesGetCursorImage(((ProgData *)pdata)->dpy); + mouse_pos_abs.x=xcim->x; + mouse_pos_abs.y=xcim->y; + mouse_pos_abs.width=xcim->width; + mouse_pos_abs.height=xcim->height; + } if(((ProgData *)pdata)->args.have_dummy_cursor){ //dummy pointer sequence //update previous_position @@ -139,6 +155,20 @@ void *GetFrame(void *pdata){ pthread_mutex_unlock(&((ProgData *)pdata)->yuv_mutex); } } + if(((ProgData *)pdata)->args.xfixes_cursor){ + //avoid segfaults + CLIP_DUMMY_POINTER_AREA(mouse_pos_abs,&((ProgData *)pdata)->brwin,&mouse_pos_temp); + //draw the cursor + if((mouse_pos_temp.x>=0)&&(mouse_pos_temp.y>=0)&&(mouse_pos_temp.width>0)&&(mouse_pos_temp.height>0)){ + XFIXES_POINTER_TO_YUV((&((ProgData *)pdata)->enc_data->yuv),((unsigned char*)xcim->pixels), + (mouse_pos_temp.x-((ProgData *)pdata)->brwin.rgeom.x+((ProgData *)pdata)->enc_data->x_offset), + (mouse_pos_temp.y-((ProgData *)pdata)->brwin.rgeom.y+((ProgData *)pdata)->enc_data->y_offset), + mouse_pos_temp.width, + mouse_pos_temp.height, + (xcim->width-mouse_pos_temp.width)); + } + } + if(((ProgData *)pdata)->args.have_dummy_cursor){ //avoid segfaults CLIP_DUMMY_POINTER_AREA(mouse_pos_abs,&((ProgData *)pdata)->brwin,&mouse_pos_temp); -- cgit v1.2.1