summaryrefslogtreecommitdiff
path: root/recordmydesktop/src/get_frame.c
diff options
context:
space:
mode:
authoriovar <iovar@f606c939-3180-4ac9-a4b8-4b8779d57d0a>2007-06-08 17:13:18 +0000
committeriovar <iovar@f606c939-3180-4ac9-a4b8-4b8779d57d0a>2007-06-08 17:13:18 +0000
commit4f503e6e9c824176f29ecebf6b6adb5e24567214 (patch)
treebd562b4ed6337268686d9ec3d427b5b339fe02ae /recordmydesktop/src/get_frame.c
parent9fbea91679d7f77b2da88a09d6a77afc5498132f (diff)
get_frame.c: calculate x and y offset of the cursor so that it will appear
correctly. git-svn-id: https://recordmydesktop.svn.sourceforge.net/svnroot/recordmydesktop/trunk@346 f606c939-3180-4ac9-a4b8-4b8779d57d0a
Diffstat (limited to 'recordmydesktop/src/get_frame.c')
-rw-r--r--recordmydesktop/src/get_frame.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/recordmydesktop/src/get_frame.c b/recordmydesktop/src/get_frame.c
index 7021dde..9cdfc6a 100644
--- a/recordmydesktop/src/get_frame.c
+++ b/recordmydesktop/src/get_frame.c
@@ -280,9 +280,18 @@ void *GetFrame(ProgData *pdata){
pthread_mutex_unlock(&pdata->yuv_mutex);
}
if(pdata->args.xfixes_cursor){
+ int mouse_xoffset,
+ mouse_yoffset;
//avoid segfaults
CLIP_DUMMY_POINTER_AREA(mouse_pos_abs,&pdata->brwin,
&mouse_pos_temp);
+ mouse_xoffset=mouse_pos_temp.x-mouse_pos_abs.x;
+ mouse_yoffset=mouse_pos_temp.y-mouse_pos_abs.y;
+ if((mouse_xoffset<0) || (mouse_xoffset>mouse_pos_abs.width))
+ mouse_xoffset=0;
+ if((mouse_yoffset<0) || (mouse_yoffset>mouse_pos_abs.height))
+ mouse_yoffset=0;
+
//draw the cursor
if((mouse_pos_temp.x>=0)&&
(mouse_pos_temp.y>=0)&&
@@ -298,6 +307,8 @@ void *GetFrame(ProgData *pdata){
pdata->enc_data->y_offset),
mouse_pos_temp.width,
mouse_pos_temp.height,
+ mouse_xoffset,
+ mouse_yoffset,
(xcim->width-mouse_pos_temp.width));
}
XFree(xcim);
@@ -305,9 +316,17 @@ void *GetFrame(ProgData *pdata){
}
if(pdata->args.have_dummy_cursor){
+ int mouse_xoffset,
+ mouse_yoffset;
//avoid segfaults
CLIP_DUMMY_POINTER_AREA(mouse_pos_abs,&pdata->brwin,
&mouse_pos_temp);
+ mouse_xoffset=mouse_pos_temp.x-mouse_pos_abs.x;
+ mouse_yoffset=mouse_pos_temp.y-mouse_pos_abs.y;
+ if((mouse_xoffset<0) || (mouse_xoffset>mouse_pos_abs.width))
+ mouse_xoffset=0;
+ if((mouse_yoffset<0) || (mouse_yoffset>mouse_pos_abs.height))
+ mouse_yoffset=0;
//draw the cursor
if((mouse_pos_temp.x>=0)&&
(mouse_pos_temp.y>=0)&&
@@ -323,6 +342,8 @@ void *GetFrame(ProgData *pdata){
pdata->enc_data->y_offset),
mouse_pos_temp.width,
mouse_pos_temp.height,
+ mouse_xoffset,
+ mouse_yoffset,
pdata->npxl);
}
}
© All Rights Reserved