more restrictive to keep clients on screen in more cases
This commit is contained in:
parent
1bf9de3809
commit
eac3a64917
1 changed files with 13 additions and 11 deletions
|
@ -815,7 +815,7 @@ gboolean client_find_onscreen(ObClient *self, gint *x, gint *y, gint w, gint h,
|
||||||
if (!rude) {
|
if (!rude) {
|
||||||
Point oldtl, oldtr, oldbl, oldbr;
|
Point oldtl, oldtr, oldbl, oldbr;
|
||||||
Point newtl, newtr, newbl, newbr;
|
Point newtl, newtr, newbl, newbr;
|
||||||
gboolean stationary;
|
gboolean stationary_l, stationary_r, stationary_t, stationary_b;
|
||||||
|
|
||||||
POINT_SET(oldtl, self->frame->area.x, self->frame->area.y);
|
POINT_SET(oldtl, self->frame->area.x, self->frame->area.y);
|
||||||
POINT_SET(oldbr, self->frame->area.x + self->frame->area.width - 1,
|
POINT_SET(oldbr, self->frame->area.x + self->frame->area.width - 1,
|
||||||
|
@ -829,20 +829,22 @@ gboolean client_find_onscreen(ObClient *self, gint *x, gint *y, gint w, gint h,
|
||||||
POINT_SET(newbl, newtl.x, newbr.y);
|
POINT_SET(newbl, newtl.x, newbr.y);
|
||||||
|
|
||||||
/* is it moving or just resizing from some corner? */
|
/* is it moving or just resizing from some corner? */
|
||||||
stationary = (POINT_EQUAL(oldtl, newtl) || POINT_EQUAL(oldtr, newtr) ||
|
stationary_l = oldtl.x == oldtl.x;
|
||||||
POINT_EQUAL(oldbl, newbl) || POINT_EQUAL(oldbr, newbr));
|
stationary_r = oldtr.x == oldtr.x;
|
||||||
|
stationary_t = oldtl.y == oldtl.y;
|
||||||
|
stationary_b = oldbl.y == oldbl.y;
|
||||||
|
|
||||||
/* if left edge is growing */
|
/* if left edge is growing and didnt move right edge */
|
||||||
if (stationary && newtl.x < oldtl.x)
|
if (stationary_r && newtl.x < oldtl.x)
|
||||||
rudel = TRUE;
|
rudel = TRUE;
|
||||||
/* if right edge is growing */
|
/* if right edge is growing and didnt move left edge */
|
||||||
if (stationary && newtr.x > oldtr.x)
|
if (stationary_l && newtr.x > oldtr.x)
|
||||||
ruder = TRUE;
|
ruder = TRUE;
|
||||||
/* if top edge is growing */
|
/* if top edge is growing and didnt move bottom edge */
|
||||||
if (stationary && newtl.y < oldtl.y)
|
if (stationary_b && newtl.y < oldtl.y)
|
||||||
rudet = TRUE;
|
rudet = TRUE;
|
||||||
/* if bottom edge is growing */
|
/* if bottom edge is growing and didnt move top edge */
|
||||||
if (stationary && newbl.y > oldbl.y)
|
if (stationary_t && newbl.y > oldbl.y)
|
||||||
rudeb = TRUE;
|
rudeb = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue