plug memory leaks from the new strut code

This commit is contained in:
Dana Jansens 2007-06-13 01:58:34 +00:00
parent 7a6a516b8e
commit 9586e3bf14
8 changed files with 35 additions and 9 deletions

View file

@ -1993,6 +1993,7 @@ void client_update_strut(ObClient *self)
a->x, a->x + a->width - 1,
a->y, a->y + a->height - 1,
a->x, a->x + a->width - 1);
g_free(a);
}
g_free(data);
}
@ -2393,6 +2394,9 @@ gboolean client_has_parent(ObClient *self)
static ObStackingLayer calc_layer(ObClient *self)
{
ObStackingLayer l;
Rect *monitor;
monitor = screen_physical_area_monitor(client_monitor(self));
if (self->type == OB_CLIENT_TYPE_DESKTOP)
l = OB_STACKING_LAYER_DESKTOP;
@ -2406,15 +2410,15 @@ static ObStackingLayer calc_layer(ObClient *self)
*/
(self->decorations == 0 &&
!(self->max_horz && self->max_vert) &&
RECT_EQUAL(self->area,
*screen_physical_area_monitor
(client_monitor(self))))) &&
RECT_EQUAL(self->area, *monitor))) &&
(client_focused(self) || client_search_focus_tree(self)))
l = OB_STACKING_LAYER_FULLSCREEN;
else if (self->above) l = OB_STACKING_LAYER_ABOVE;
else if (self->below) l = OB_STACKING_LAYER_BELOW;
else l = OB_STACKING_LAYER_NORMAL;
g_free(monitor);
return l;
}
@ -2720,6 +2724,8 @@ void client_try_configure(ObClient *self, gint *x, gint *y, gint *w, gint *h,
user = FALSE; /* ignore if the client can't be moved/resized when it
is fullscreening */
g_free(a);
} else if (self->max_horz || self->max_vert) {
Rect *a;
guint i;

View file

@ -522,6 +522,8 @@ void dock_configure()
dock->h += ob_rr_theme->obwidth * 2;
screen_update_areas();
g_free(a);
}
void dock_app_configure(ObDockApp *app, gint w, gint h)

View file

@ -433,6 +433,8 @@ static void popup_render(ObFocusCyclePopup *p, const ObClient *c)
RrPaint(p->a_text, p->text, textw, texth);
p->last_target = newtarget;
g_free(screen_area);
}
void focus_cycle_popup_show(ObClient *c, gboolean iconic_windows,
@ -511,6 +513,7 @@ void focus_cycle_popup_single_show(struct _ObClient *c,
icon_popup_min_width(single_popup, POPUP_WIDTH);
icon_popup_max_width(single_popup, MAX(a->width/3, POPUP_WIDTH));
icon_popup_text_width(single_popup, popup.maxtextw);
g_free(a);
}
text = popup_get_name(c);

View file

@ -1581,6 +1581,7 @@ static gboolean frame_animate_iconify(gpointer p)
iconx = self->area.x + self->area.width / 2 + 32;
icony = a->y + a->width;
iconw = 64;
g_free(a);
} else {
iconx = self->client->icon_geometry.x;
icony = self->client->icon_geometry.y;

View file

@ -103,6 +103,7 @@ static void set_curpos(KeyBindingTree *newpos)
/* 1 second delay for the popup to show */
popup_delay_show(popup, G_USEC_PER_SEC, text);
g_free(text);
g_free(a);
} else {
popup_hide(popup);
}

View file

@ -343,6 +343,8 @@ void menu_frame_move_on_screen(ObMenuFrame *self, gint x, gint y,
*dx = MAX(*dx, a->x - x);
*dy = MAX(*dy, a->y - y);
}
g_free(a);
}
static void menu_entry_frame_render(ObMenuEntryFrame *self)
@ -888,6 +890,8 @@ static void menu_frame_update(ObMenuFrame *self)
}
}
g_free(a);
menu_frame_render(self);
}
@ -948,8 +952,10 @@ gboolean menu_frame_show_topmenu(ObMenuFrame *self, gint x, gint y,
/* find the monitor the menu is on */
for (i = 0; i < screen_num_monitors; ++i) {
Rect *a = screen_physical_area_monitor(i);
if (RECT_CONTAINS(*a, x, y)) {
Rect a = screen_physical_area_monitor(i);
gboolean contains = RECT_CONTAINS(*a, x, y);
g_free(a);
if (contains) {
self->monitor = i;
break;
}

View file

@ -45,10 +45,12 @@ static Rect *pick_pointer_head(ObClient *c)
screen_pointer_pos(&px, &py);
for (i = 0; i < screen_num_monitors; ++i) {
if (RECT_CONTAINS(*screen_physical_area_monitor(i), px, py)) {
for (i = 0; i < screen_num_monitors; ++i) {
Rect *monitor = screen_physical_area_monitor(i);
gboolean contain = RECT_CONTAINS(*monitor, px, py);
g_free(monitor);
if (contain)
return screen_area_monitor(c->desktop, i, NULL);
}
}
g_assert_not_reached();
}
@ -111,7 +113,10 @@ static Rect **pick_head(ObClient *c)
screen_pointer_pos(&px, &py);
for (i = 0; i < screen_num_monitors; i++)
if (RECT_CONTAINS(*screen_physical_area_monitor(i), px, py)) {
Rect *monitor = screen_physical_area_monitor(i);
gboolean contain = RECT_CONTAINS(*monitor, px, py);
g_free(monitor);
if (contain)
add_choice(choice, i);
ob_debug("placement adding choice %d for mouse pointer\n", i);
break;

View file

@ -281,6 +281,8 @@ void popup_delay_show(ObPopup *self, gulong usec, gchar *text)
popup_show_timeout(self);
}
}
g_free(area);
}
void popup_hide(ObPopup *self)