From: Arnout E. <no...@bz...> - 2011-03-05 00:47:56
|
On Sat, Feb 19, 2011 at 04:41:28AM +0100, Arnout Engelen wrote: > Some applications show dialogs that are incorrectly placed - they might even > position them off-screen. > > To move around transient popups, modifying the 'attrs' (for example at > ioncore/clientwin.c:543) will affect where the window shows up. > > For 'non-transient dialogs', however, this does not appear to affect the > window location I was somewhat off-the-mark here: changing the 'attrs' for these popups does effect them. In this particular case, however, immediately after mapping the dialog, it would be moved again with a XConfigureRequestEvent. This XConfigureRequestEvent changes the window location (flags CWX and CWY) but not the dimensions (flags CWWidth and CWHeight). check_normal_cfgrq() in ioncore/clientwin.c interprets this as the new x/y coordinates being 'hard' and the current height/width being 'weak' suggestions. In this particular case, because the x coordinate is too high, moving the dialog off-screen, and the width was considered 'weak', the width got reduced to '0'. I'd say we should take into account the dimensions even when only the location is being specified. The following patch does that: diff --git a/ioncore/clientwin.c b/ioncore/clientwin.c index 9ec1b68..27bd85e 100644 --- a/ioncore/clientwin.c +++ b/ioncore/clientwin.c @@ -1231,10 +1231,12 @@ static bool check_normal_cfgrq(WClientWin *cwin, XConfigureRequestEvent *ev) if(ev->value_mask&CWX){ rq.geom.x=ev->x+gdx; rq.flags&=~REGION_RQGEOM_WEAK_X; + rq.flags&=~REGION_RQGEOM_WEAK_W; } if(ev->value_mask&CWY){ rq.geom.y=ev->y+gdy; rq.flags&=~REGION_RQGEOM_WEAK_Y; + rq.flags&=~REGION_RQGEOM_WEAK_H; } region_rqgeom((WRegion*)cwin, &rq, NULL); This seems to make sense and indeed it fixes the problems I previously encountered with applications misplacing their dialogs. I haven't noticed any negative side-effects yet. I'd appreciate it if anyone could comment/review/test ;). Kind regards, Arnout |