plug memory leaks from the new strut code
This commit is contained in:
parent
7a6a516b8e
commit
9586e3bf14
8 changed files with 35 additions and 9 deletions
|
@ -1993,6 +1993,7 @@ void client_update_strut(ObClient *self)
|
||||||
a->x, a->x + a->width - 1,
|
a->x, a->x + a->width - 1,
|
||||||
a->y, a->y + a->height - 1,
|
a->y, a->y + a->height - 1,
|
||||||
a->x, a->x + a->width - 1);
|
a->x, a->x + a->width - 1);
|
||||||
|
g_free(a);
|
||||||
}
|
}
|
||||||
g_free(data);
|
g_free(data);
|
||||||
}
|
}
|
||||||
|
@ -2393,6 +2394,9 @@ gboolean client_has_parent(ObClient *self)
|
||||||
static ObStackingLayer calc_layer(ObClient *self)
|
static ObStackingLayer calc_layer(ObClient *self)
|
||||||
{
|
{
|
||||||
ObStackingLayer l;
|
ObStackingLayer l;
|
||||||
|
Rect *monitor;
|
||||||
|
|
||||||
|
monitor = screen_physical_area_monitor(client_monitor(self));
|
||||||
|
|
||||||
if (self->type == OB_CLIENT_TYPE_DESKTOP)
|
if (self->type == OB_CLIENT_TYPE_DESKTOP)
|
||||||
l = OB_STACKING_LAYER_DESKTOP;
|
l = OB_STACKING_LAYER_DESKTOP;
|
||||||
|
@ -2406,15 +2410,15 @@ static ObStackingLayer calc_layer(ObClient *self)
|
||||||
*/
|
*/
|
||||||
(self->decorations == 0 &&
|
(self->decorations == 0 &&
|
||||||
!(self->max_horz && self->max_vert) &&
|
!(self->max_horz && self->max_vert) &&
|
||||||
RECT_EQUAL(self->area,
|
RECT_EQUAL(self->area, *monitor))) &&
|
||||||
*screen_physical_area_monitor
|
|
||||||
(client_monitor(self))))) &&
|
|
||||||
(client_focused(self) || client_search_focus_tree(self)))
|
(client_focused(self) || client_search_focus_tree(self)))
|
||||||
l = OB_STACKING_LAYER_FULLSCREEN;
|
l = OB_STACKING_LAYER_FULLSCREEN;
|
||||||
else if (self->above) l = OB_STACKING_LAYER_ABOVE;
|
else if (self->above) l = OB_STACKING_LAYER_ABOVE;
|
||||||
else if (self->below) l = OB_STACKING_LAYER_BELOW;
|
else if (self->below) l = OB_STACKING_LAYER_BELOW;
|
||||||
else l = OB_STACKING_LAYER_NORMAL;
|
else l = OB_STACKING_LAYER_NORMAL;
|
||||||
|
|
||||||
|
g_free(monitor);
|
||||||
|
|
||||||
return l;
|
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
|
user = FALSE; /* ignore if the client can't be moved/resized when it
|
||||||
is fullscreening */
|
is fullscreening */
|
||||||
|
|
||||||
|
g_free(a);
|
||||||
} else if (self->max_horz || self->max_vert) {
|
} else if (self->max_horz || self->max_vert) {
|
||||||
Rect *a;
|
Rect *a;
|
||||||
guint i;
|
guint i;
|
||||||
|
|
|
@ -522,6 +522,8 @@ void dock_configure()
|
||||||
dock->h += ob_rr_theme->obwidth * 2;
|
dock->h += ob_rr_theme->obwidth * 2;
|
||||||
|
|
||||||
screen_update_areas();
|
screen_update_areas();
|
||||||
|
|
||||||
|
g_free(a);
|
||||||
}
|
}
|
||||||
|
|
||||||
void dock_app_configure(ObDockApp *app, gint w, gint h)
|
void dock_app_configure(ObDockApp *app, gint w, gint h)
|
||||||
|
|
|
@ -433,6 +433,8 @@ static void popup_render(ObFocusCyclePopup *p, const ObClient *c)
|
||||||
RrPaint(p->a_text, p->text, textw, texth);
|
RrPaint(p->a_text, p->text, textw, texth);
|
||||||
|
|
||||||
p->last_target = newtarget;
|
p->last_target = newtarget;
|
||||||
|
|
||||||
|
g_free(screen_area);
|
||||||
}
|
}
|
||||||
|
|
||||||
void focus_cycle_popup_show(ObClient *c, gboolean iconic_windows,
|
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_min_width(single_popup, POPUP_WIDTH);
|
||||||
icon_popup_max_width(single_popup, MAX(a->width/3, POPUP_WIDTH));
|
icon_popup_max_width(single_popup, MAX(a->width/3, POPUP_WIDTH));
|
||||||
icon_popup_text_width(single_popup, popup.maxtextw);
|
icon_popup_text_width(single_popup, popup.maxtextw);
|
||||||
|
g_free(a);
|
||||||
}
|
}
|
||||||
|
|
||||||
text = popup_get_name(c);
|
text = popup_get_name(c);
|
||||||
|
|
|
@ -1581,6 +1581,7 @@ static gboolean frame_animate_iconify(gpointer p)
|
||||||
iconx = self->area.x + self->area.width / 2 + 32;
|
iconx = self->area.x + self->area.width / 2 + 32;
|
||||||
icony = a->y + a->width;
|
icony = a->y + a->width;
|
||||||
iconw = 64;
|
iconw = 64;
|
||||||
|
g_free(a);
|
||||||
} else {
|
} else {
|
||||||
iconx = self->client->icon_geometry.x;
|
iconx = self->client->icon_geometry.x;
|
||||||
icony = self->client->icon_geometry.y;
|
icony = self->client->icon_geometry.y;
|
||||||
|
|
|
@ -103,6 +103,7 @@ static void set_curpos(KeyBindingTree *newpos)
|
||||||
/* 1 second delay for the popup to show */
|
/* 1 second delay for the popup to show */
|
||||||
popup_delay_show(popup, G_USEC_PER_SEC, text);
|
popup_delay_show(popup, G_USEC_PER_SEC, text);
|
||||||
g_free(text);
|
g_free(text);
|
||||||
|
g_free(a);
|
||||||
} else {
|
} else {
|
||||||
popup_hide(popup);
|
popup_hide(popup);
|
||||||
}
|
}
|
||||||
|
|
|
@ -343,6 +343,8 @@ void menu_frame_move_on_screen(ObMenuFrame *self, gint x, gint y,
|
||||||
*dx = MAX(*dx, a->x - x);
|
*dx = MAX(*dx, a->x - x);
|
||||||
*dy = MAX(*dy, a->y - y);
|
*dy = MAX(*dy, a->y - y);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
g_free(a);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void menu_entry_frame_render(ObMenuEntryFrame *self)
|
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);
|
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 */
|
/* find the monitor the menu is on */
|
||||||
for (i = 0; i < screen_num_monitors; ++i) {
|
for (i = 0; i < screen_num_monitors; ++i) {
|
||||||
Rect *a = screen_physical_area_monitor(i);
|
Rect a = screen_physical_area_monitor(i);
|
||||||
if (RECT_CONTAINS(*a, x, y)) {
|
gboolean contains = RECT_CONTAINS(*a, x, y);
|
||||||
|
g_free(a);
|
||||||
|
if (contains) {
|
||||||
self->monitor = i;
|
self->monitor = i;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,10 +45,12 @@ static Rect *pick_pointer_head(ObClient *c)
|
||||||
|
|
||||||
screen_pointer_pos(&px, &py);
|
screen_pointer_pos(&px, &py);
|
||||||
|
|
||||||
for (i = 0; i < screen_num_monitors; ++i) {
|
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)
|
||||||
return screen_area_monitor(c->desktop, i, NULL);
|
return screen_area_monitor(c->desktop, i, NULL);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
g_assert_not_reached();
|
g_assert_not_reached();
|
||||||
}
|
}
|
||||||
|
@ -111,7 +113,10 @@ static Rect **pick_head(ObClient *c)
|
||||||
screen_pointer_pos(&px, &py);
|
screen_pointer_pos(&px, &py);
|
||||||
|
|
||||||
for (i = 0; i < screen_num_monitors; i++)
|
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);
|
add_choice(choice, i);
|
||||||
ob_debug("placement adding choice %d for mouse pointer\n", i);
|
ob_debug("placement adding choice %d for mouse pointer\n", i);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -281,6 +281,8 @@ void popup_delay_show(ObPopup *self, gulong usec, gchar *text)
|
||||||
popup_show_timeout(self);
|
popup_show_timeout(self);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
g_free(area);
|
||||||
}
|
}
|
||||||
|
|
||||||
void popup_hide(ObPopup *self)
|
void popup_hide(ObPopup *self)
|
||||||
|
|
Loading…
Reference in a new issue