From 7c3c03388a164efb11ea4b679d8c47d09960209d Mon Sep 17 00:00:00 2001 From: Jon Trulson Date: Wed, 11 Apr 2018 16:12:52 -0600 Subject: [PATCH] dtfile/Encaps: CID 174844 --- cde/programs/dtfile/Encaps.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) 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 */ -- 2.25.1