summaryrefslogtreecommitdiff
path: root/recordmydesktop/src
diff options
context:
space:
mode:
authoriovar <iovar@f606c939-3180-4ac9-a4b8-4b8779d57d0a>2006-12-09 16:55:42 +0000
committeriovar <iovar@f606c939-3180-4ac9-a4b8-4b8779d57d0a>2006-12-09 16:55:42 +0000
commitbf02a88599e0e03d822eae3d30afdacd67c98457 (patch)
tree2d2489760b036be634dd3b317d759402b107abcc /recordmydesktop/src
parent9659592e810f34724abbb76d072472ceca4bbc97 (diff)
Patch for non-compliant window managers,
by Andreas Zwinkau git-svn-id: https://recordmydesktop.svn.sourceforge.net/svnroot/recordmydesktop/trunk@227 f606c939-3180-4ac9-a4b8-4b8779d57d0a
Diffstat (limited to 'recordmydesktop/src')
-rw-r--r--recordmydesktop/src/wm_check.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/recordmydesktop/src/wm_check.c b/recordmydesktop/src/wm_check.c
index ee6b0ba..ac25efb 100644
--- a/recordmydesktop/src/wm_check.c
+++ b/recordmydesktop/src/wm_check.c
@@ -29,7 +29,7 @@
char *rmdWMCheck(Display *dpy,Window root){
- Window *wm_child;
+ Window *wm_child=NULL;
Atom nwm_atom,
utf8_string,
wm_name_atom,
@@ -46,21 +46,23 @@ char *rmdWMCheck(Display *dpy,Window root){
wm_name_atom =XInternAtom(dpy,"_NET_WM_NAME",True);
if(nwm_atom!=None && wm_name_atom!=None){
- if(!((XGetWindowProperty( dpy,root,nwm_atom,0,100,
+ if(XGetWindowProperty( dpy,root,nwm_atom,0,100,
False,XA_WINDOW,
&rt,&fmt,&nitems, &nbytes,
(unsigned char **)((void*)&wm_child))
- ==Success ) &&
- (XGetWindowProperty( dpy,*wm_child,wm_name_atom,0,100,
+ != Success ){
+ fprintf(stderr,"Error while trying to get a window to identify the window manager.\n");
+ }
+ if((wm_child == NULL) || (XGetWindowProperty( dpy,*wm_child,wm_name_atom,0,100,
False,utf8_string,&rt,
&fmt,&nitems, &nbytes,
(unsigned char **)((void*)&wm_name_str))
- ==Success ))){
+ != Success )){
fprintf(stderr,"Warning!!!\nYour window manager appears to be non-compliant!\n");
}
}
fprintf(stderr,"Your window manager appears to be %s\n\n",
- ((wm_name_str!=NULL)?wm_name_str:"Uknown"));
+ ((wm_name_str!=NULL)?wm_name_str:"Unknown"));
return wm_name_str;
© All Rights Reserved