ObPopup *popup_new(void)
{
XSetWindowAttributes attrib;
- ObPopup *self = g_new0(ObPopup, 1);
+ ObPopup *self = g_slice_new0(ObPopup);
self->obwin.type = OB_WINDOW_CLASS_INTERNAL;
self->gravity = NorthWestGravity;
RrAppearanceFree(self->a_text);
window_remove(self->bg);
stacking_remove(self);
- g_free(self);
+ g_slice_free(ObPopup, self);
}
}
gint emptyx, emptyy; /* empty space between elements */
gint textx, texty, textw, texth;
gint iconx, icony, iconw, iconh;
- Rect *area, mon;
+ const Rect *area;
+ Rect mon;
gboolean hasicon = self->hasicon;
/* when there is no icon and the text is not parent relative, then
x=MAX(MIN(x, area->x+area->width-w),area->x);
y=MAX(MIN(y, area->y+area->height-h),area->y);
- g_free(area);
-
if (m == screen_num_monitors) {
RECT_SET(mon, x, y, w, h);
m = screen_find_monitor(&mon);
x=MAX(MIN(x, area->x+area->width-w),area->x);
y=MAX(MIN(y, area->y+area->height-h),area->y);
-
- g_free(area);
}
/* set the windows/appearances up */
{
ObIconPopup *self;
- self = g_new0(ObIconPopup, 1);
+ self = g_slice_new0(ObIconPopup);
self->popup = popup_new();
self->a_icon = RrAppearanceCopy(ob_rr_theme->a_clear_tex);
self->icon = XCreateWindow(obt_display, self->popup->bg,
XDestroyWindow(obt_display, self->icon);
RrAppearanceFree(self->a_icon);
popup_free(self->popup);
- g_free(self);
+ g_slice_free(ObIconPopup, self);
}
}
{
ObPagerPopup *self;
- self = g_new(ObPagerPopup, 1);
+ self = g_slice_new(ObPagerPopup);
self->popup = popup_new();
self->desks = 0;
RrAppearanceFree(self->hilight);
RrAppearanceFree(self->unhilight);
popup_free(self->popup);
- g_free(self);
+ g_slice_free(ObPagerPopup, self);
}
}