summaryrefslogtreecommitdiff
path: root/rMD-exp
diff options
context:
space:
mode:
Diffstat (limited to 'rMD-exp')
-rw-r--r--rMD-exp/include/recordmydesktop.h3
-rw-r--r--rMD-exp/src/poll_damage.c43
2 files changed, 38 insertions, 8 deletions
diff --git a/rMD-exp/include/recordmydesktop.h b/rMD-exp/include/recordmydesktop.h
index be10596..6031614 100644
--- a/rMD-exp/include/recordmydesktop.h
+++ b/rMD-exp/include/recordmydesktop.h
@@ -305,8 +305,7 @@ unsigned char Yr[256],Yg[256],Yb[256],
Vr[256],Vg[256],Vb[256];
//the following values are of no effect
//but they might be usefull later for profiling
-unsigned int inserts,//total insertions in the lists
- frames_total,//frames calculated by total time expirations
+unsigned int frames_total,//frames calculated by total time expirations
frames_lost;//the value of shame
//used to determine frame drop which can
//happen on failure to receive a signal over a condition variable
diff --git a/rMD-exp/src/poll_damage.c b/rMD-exp/src/poll_damage.c
index 259039f..1f53349 100644
--- a/rMD-exp/src/poll_damage.c
+++ b/rMD-exp/src/poll_damage.c
@@ -28,17 +28,48 @@
#include <recordmydesktop.h>
void *PollDamage(void *pdata){
-
- Damage damage;
+ Window root_return,
+ parent_return,
+ *children;
+ unsigned int i,
+ nchildren,
+ inserts=0;
XEvent event;
- inserts=0;
+
+ XSelectInput (((ProgData *)pdata)->dpy,((ProgData *)pdata)->specs.root, SubstructureNotifyMask);
+
+ XQueryTree (((ProgData *)pdata)->dpy,
+ ((ProgData *)pdata)->specs.root,
+ &root_return,
+ &parent_return,
+ &children,
+ &nchildren);
+
+ for (i = 0; i < nchildren; i++){
+ XWindowAttributes attribs;
+ if (XGetWindowAttributes (((ProgData *)pdata)->dpy,children[i],&attribs)){
+ if (!attribs.override_redirect && attribs.depth==((ProgData *)pdata)->specs.depth)
+ XDamageCreate (((ProgData *)pdata)->dpy, children[i],XDamageReportRawRectangles);
+ }
+ }
+
+ XDamageCreate( ((ProgData *)pdata)->dpy, ((ProgData *)pdata)->brwin.windowid, XDamageReportRawRectangles);
- damage= XDamageCreate( ((ProgData *)pdata)->dpy, ((ProgData *)pdata)->brwin.windowid, XDamageReportRawRectangles);
while(((ProgData *)pdata)->running){
//damage polling doesn't stop,eventually full image may be needed
+ //30/10/2006 : when and why did I write the above line? what did I mean?
XNextEvent(((ProgData *)pdata)->dpy,&event);
- if(event.type == ((ProgData *)pdata)->damage_event + XDamageNotify ){
+ if (event.type == MapNotify ){
+ XWindowAttributes attribs;
+ if (XGetWindowAttributes (((ProgData *)pdata)->dpy,
+ event.xcreatewindow.window,
+ &attribs)){
+ if (!attribs.override_redirect && attribs.depth==((ProgData *)pdata)->specs.depth)
+ XDamageCreate (((ProgData *)pdata)->dpy,event.xcreatewindow.window,XDamageReportRawRectangles);
+ }
+ }
+ else if(event.type == ((ProgData *)pdata)->damage_event + XDamageNotify ){
XDamageNotifyEvent *e =(XDamageNotifyEvent *)( &event );
WGeometry wgeom;
CLIP_EVENT_AREA(e,&(((ProgData *)pdata)->brwin),&wgeom);
@@ -50,8 +81,8 @@ void *PollDamage(void *pdata){
pthread_mutex_unlock(&((ProgData *)pdata)->list_mutex[tlist_sel]);
}
}
+
}
- XDamageDestroy(((ProgData *)pdata)->dpy,damage);
pthread_exit(&errno);
}
© All Rights Reserved