X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Fresist.c;h=12f56329a65e2676ddb0370400ef23ba512cb3c8;hb=HEAD;hp=dc5e343c03b6cfa64b35bcf70af348e512dfcabb;hpb=50d662681160c309ea86268c0d05794b87b75593;p=chaz%2Fopenbox diff --git a/openbox/resist.c b/openbox/resist.c index dc5e343c..12f56329 100644 --- a/openbox/resist.c +++ b/openbox/resist.c @@ -135,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 */ @@ -161,15 +162,14 @@ void resist_move_monitors(ObClient *c, gint resist, gint *x, gint *y) cr = RECT_RIGHT(c->frame->area); cb = RECT_BOTTOM(c->frame->area); - RECT_SET(desired_area, *x, *y, c->area.width, c->area.height); + RECT_SET(desired_area, c->frame->area.x, c->frame->area.y, + c->frame->area.width, c->frame->area.height); 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); @@ -201,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); @@ -325,7 +324,8 @@ 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 */ guint i; @@ -343,10 +343,8 @@ void resist_size_monitors(ObClient *c, gint resist, gint *w, gint *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); @@ -413,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); } }