From 1e10aa5728fa7c49d8759af44460e993c9a8c423 Mon Sep 17 00:00:00 2001 From: Dave Foster Date: Fri, 22 Aug 2008 23:29:23 -0400 Subject: [PATCH] Move now has resistance. --- openbox/resist.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) 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, -- 2.34.1