From: Jon Trulson Date: Wed, 11 Apr 2018 22:12:52 +0000 (-0600) Subject: dtfile/Encaps: CID 174844 X-Git-Tag: 2.2.4a~92 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=7c3c03388a164efb11ea4b679d8c47d09960209d;p=oweals%2Fcde.git dtfile/Encaps: CID 174844 --- diff --git a/cde/programs/dtfile/Encaps.c b/cde/programs/dtfile/Encaps.c index 7bfc6550..5da587da 100644 --- a/cde/programs/dtfile/Encaps.c +++ b/cde/programs/dtfile/Encaps.c @@ -2486,24 +2486,30 @@ static Boolean GetXineramaScreenDimensions( unsigned int wx, wy; unsigned int i, sx, sy, sw, sh; - while(w && !XtIsShell(w)) w=XtParent (w); + while (w && !XtIsShell(w)) + w=XtParent (w); wx=XtX(w); wy=XtY(w); - if(!(dt_xi=_DtXineramaInit(XtDisplay(w)))) return False; + if (!(dt_xi=_DtXineramaInit(XtDisplay(w)))) return False; - for(i=0; inumscreens; i++){ - if(!_DtXineramaGetScreen(dt_xi,i,&sw,&sh,&sx,&sy))break; + for (i=0; inumscreens; i++){ + if (!_DtXineramaGetScreen(dt_xi,i,&sw,&sh,&sx,&sy)) + break; - if(wx>=sx && wx<(sx+sw) && wy>=sy && wy<(sy+sh)){ + if (wx>=sx && wx<(sx+sw) && wy>=sy && wy<(sy+sh)) + { *s_width=(int)sw; *s_height=(int)sh; *org_x=(int)sx; *org_y=(int)sy; + free(dt_xi); return True; } } - return False; + + free(dt_xi); + return False; } #endif /* USE_XINERAMA */