From: Dave Foster Date: Sat, 23 Aug 2008 03:29:23 +0000 (-0400) Subject: Move now has resistance. X-Git-Tag: mikabox-3.4.7.2~30^2~2 X-Git-Url: http://git.openbox.org/?a=commitdiff_plain;h=1e10aa5728fa7c49d8759af44460e993c9a8c423;p=mikachu%2Fopenbox.git Move now has resistance. --- diff --git a/openbox/resist.c b/openbox/resist.c index bfffecf8..6843605e 100644 --- a/openbox/resist.c +++ b/openbox/resist.c @@ -127,6 +127,12 @@ void resist_move_windows(ObClient *c, gint resist, gint *x, gint *y) if (target->below && !c->below && target->skip_taskbar) continue; + /* check window boundary as it is */ + if (resist_move_window(c->frame->area, target->frame->area, + resist, x, y)) + break; + + /* now check window with the expanded margin area */ RECT_SET(expand, target->frame->area.x - config_margins.left, target->frame->area.y - config_margins.top, target->frame->area.width + config_margins.left + config_margins.right, @@ -305,6 +311,7 @@ void resist_size_windows(ObClient *c, gint resist, gint *w, gint *h, GList *it; ObClient *target; /* target */ Rect dock_area; + Rect expand; if (!resist) return; @@ -320,9 +327,21 @@ void resist_size_windows(ObClient *c, gint resist, gint *w, gint *h, if (target->below && !c->below && target->skip_taskbar) continue; + /* resist against normal window size */ if (resist_size_window(c->frame->area, target->frame->area, resist, w, h, dir)) break; + + /* now check window with the expanded margin area */ + RECT_SET(expand, target->frame->area.x - config_margins.left, + target->frame->area.y - config_margins.top, + target->frame->area.width + config_margins.left + config_margins.right, + target->frame->area.height + config_margins.top + config_margins.bottom); + + + if (resist_size_window(c->frame->area, expand, + resist, w, h, dir)) + break; } dock_get_area(&dock_area); resist_size_window(c->frame->area, dock_area,