summaryrefslogtreecommitdiff
path: root/recordmydesktop/src/poll_damage.c
diff options
context:
space:
mode:
authoriovar <iovar@f606c939-3180-4ac9-a4b8-4b8779d57d0a>2006-11-08 16:26:44 +0000
committeriovar <iovar@f606c939-3180-4ac9-a4b8-4b8779d57d0a>2006-11-08 16:26:44 +0000
commitad5b05712d9ed8650fcc145373ac878f8e6b8829 (patch)
tree96284e14aec9e30f72e9d2fe3b486cf1c254b225 /recordmydesktop/src/poll_damage.c
parentfd4a7480e74008c0e654ad9bf790a8fa6625e661 (diff)
Replaced all files with the ones in the rMD-exp module.
(this should have been a branch not a module, but it's too late now. rMD-exp module will be purged but if anyone's interested on the not-so descriptive commit logs, they'll be on the attic. This is the start of the 0.3 branch. Files will will be tagged as v0_3_0 in a new branch before final release. Snapshot prior to this release has tagged as v0_2_7 in a new branch. All releases will be tagged and branched from now on. git-svn-id: https://recordmydesktop.svn.sourceforge.net/svnroot/recordmydesktop/trunk@153 f606c939-3180-4ac9-a4b8-4b8779d57d0a
Diffstat (limited to 'recordmydesktop/src/poll_damage.c')
-rw-r--r--recordmydesktop/src/poll_damage.c47
1 files changed, 39 insertions, 8 deletions
diff --git a/recordmydesktop/src/poll_damage.c b/recordmydesktop/src/poll_damage.c
index 5433bbc..9bf7ee2 100644
--- a/recordmydesktop/src/poll_damage.c
+++ b/recordmydesktop/src/poll_damage.c
@@ -28,18 +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;
- int inserts=0;
-
-
- damage= XDamageCreate( ((ProgData *)pdata)->dpy, ((ProgData *)pdata)->brwin.windowid, XDamageReportRawRectangles);
+
+ 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);
+
+
while(((ProgData *)pdata)->running){
-// if(Paused)pthread_cond_wait(&((ProgData *)pdata)->pause_cond,&((ProgData *)pdata)->pause_cond_mutex);
//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 (!((XMapEvent *)(&event))->override_redirect && 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);
@@ -51,6 +81,7 @@ void *PollDamage(void *pdata){
pthread_mutex_unlock(&((ProgData *)pdata)->list_mutex[tlist_sel]);
}
}
+
}
pthread_exit(&errno);
}
© All Rights Reserved