X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Fresist.c;h=12f56329a65e2676ddb0370400ef23ba512cb3c8;hb=6eb740cf119b14903afa3028e108dd98c57ff926;hp=91eabcb08b49c8fd039b58ae3c815cf71b6e3dcd;hpb=a4b2e3a86ed7d9a530b8fa2c7711e8fbe24be399;p=chaz%2Fopenbox diff --git a/openbox/resist.c b/openbox/resist.c index 91eabcb0..12f56329 100644 --- a/openbox/resist.c +++ b/openbox/resist.c @@ -17,14 +17,13 @@ See the COPYING file for a copy of the GNU General Public License. */ +#include "resist.h" #include "client.h" #include "frame.h" #include "stacking.h" #include "screen.h" #include "dock.h" #include "config.h" -#include "resist.h" -#include "parser/parse.h" #include @@ -136,7 +135,8 @@ void resist_move_windows(ObClient *c, gint resist, gint *x, gint *y) void resist_move_monitors(ObClient *c, gint resist, gint *x, gint *y) { - Rect *area, *parea; + Rect *area; + const Rect *parea; guint i; gint l, t, r, b; /* requested edges */ gint al, at, ar, ab; /* screen area edges */ @@ -168,10 +168,8 @@ void resist_move_monitors(ObClient *c, gint resist, gint *x, gint *y) for (i = 0; i < screen_num_monitors; ++i) { parea = screen_physical_area_monitor(i); - if (!RECT_INTERSECTS_RECT(*parea, c->frame->area)) { - g_free(parea); + if (!RECT_INTERSECTS_RECT(*parea, c->frame->area)) continue; - } area = screen_area(c->desktop, SCREEN_AREA_ALL_MONITORS, &desired_area); @@ -203,8 +201,7 @@ void resist_move_monitors(ObClient *c, gint resist, gint *x, gint *y) else if (cb <= pb && b > pb && b < pb + resist) *y = pb - h + 1; - g_free(area); - g_free(parea); + g_slice_free(Rect, area); } frame_frame_gravity(c->frame, x, y); @@ -327,10 +324,10 @@ void resist_size_monitors(ObClient *c, gint resist, gint *w, gint *h, { gint l, t, r, b; /* my left, top, right and bottom sides */ gint dlt, drb; /* my destination left/top and right/bottom sides */ - Rect *area, *parea; + Rect *area; + const Rect *parea; gint al, at, ar, ab; /* screen boundaries */ gint pl, pt, pr, pb; /* physical screen boundaries */ - gint incw, inch; guint i; Rect desired_area; @@ -341,18 +338,13 @@ void resist_size_monitors(ObClient *c, gint resist, gint *w, gint *h, t = RECT_TOP(c->frame->area); b = RECT_BOTTOM(c->frame->area); - incw = c->size_inc.width; - inch = c->size_inc.height; - RECT_SET(desired_area, c->area.x, c->area.y, *w, *h); for (i = 0; i < screen_num_monitors; ++i) { parea = screen_physical_area_monitor(i); - if (!RECT_INTERSECTS_RECT(*parea, c->frame->area)) { - g_free(parea); + if (!RECT_INTERSECTS_RECT(*parea, c->frame->area)) continue; - } area = screen_area(c->desktop, SCREEN_AREA_ALL_MONITORS, &desired_area); @@ -419,7 +411,6 @@ void resist_size_monitors(ObClient *c, gint resist, gint *w, gint *h, break; } - g_free(area); - g_free(parea); + g_slice_free(Rect, area); } }