Skip to content

Commit

Permalink
Handle XConfigureRequestEvent's moving transient dialogs to incorrect…
Browse files Browse the repository at this point in the history
… locations

Some applications, in particular Java apps, tend to move transient dialogs to
invalid locations by way of XConfigureRequestEvent's.

This patch ignores X or Y values from XConfigureRequestEvent that are outside
the bounds of the frame.

When X/Y values are not out-of-bounds but still close to the right/bottom edge,
the dialog might get 'squashed'. To prevent this, we now consider width and
height to be non-'weak' even if only new X or Y values are submitted.

https://sourceforge.net/tracker/?func=detail&aid=3167262&group_id=314802&atid=1324528
  • Loading branch information
raboof committed Mar 11, 2011
1 parent 5dbc19e commit 0cd1e04
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 2 additions & 0 deletions ioncore/clientwin.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
13 changes: 12 additions & 1 deletion ioncore/sizepolicy.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,18 @@ static void sizepolicy_free_snap(WSizePolicy *szplcy, WRegion *reg,
int h=(fullh ? max_geom.h : minof(rq_geom->h, max_geom.h));
int x_=0, y_=0;


/* ignore out-of-bound values for 'x' entirely */
if(!(rq_flags&REGION_RQGEOM_WEAK_X) && rq_geom->x > max_geom.w){
rq_flags|=REGION_RQGEOM_WEAK_X;
rq_geom->x = reg->geom.x;
}

/* ignore out-of-bound values for 'y' entirely */
if(!(rq_flags&REGION_RQGEOM_WEAK_Y) && rq_geom->y > max_geom.h){
rq_flags|=REGION_RQGEOM_WEAK_Y;
rq_geom->y = reg->geom.y;
}

if(!(rq_flags&REGION_RQGEOM_WEAK_X)
&& rq_flags&REGION_RQGEOM_WEAK_W){
x_=fit_x(rq_geom->x, 1, &max_geom);
Expand Down

0 comments on commit 0cd1e04

Please sign in to comment.