#include "stacking.h"
#include "event.h"
#include "screen.h"
-#include "render/render.h"
-#include "render/theme.h"
+#include "obrender/render.h"
+#include "obrender/theme.h"
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;
self->x = self->y = self->textw = self->h = 0;
- self->a_bg = RrAppearanceCopy(ob_rr_theme->osd_hilite_bg);
+ self->a_bg = RrAppearanceCopy(ob_rr_theme->osd_bg);
self->a_text = RrAppearanceCopy(ob_rr_theme->osd_hilite_label);
self->iconwm = self->iconhm = 1;
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;
+ Rect const *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;
self->wins = g_new(Window, self->desks);
- self->hilight = RrAppearanceCopy(ob_rr_theme->osd_hilite_fg);
- self->unhilight = RrAppearanceCopy(ob_rr_theme->osd_unhilite_fg);
+ self->hilight = RrAppearanceCopy(ob_rr_theme->osd_hilite_bg);
+ self->unhilight = RrAppearanceCopy(ob_rr_theme->osd_unhilite_bg);
self->popup->hasicon = TRUE;
self->popup->draw_icon = pager_popup_draw_icon;
RrAppearanceFree(self->hilight);
RrAppearanceFree(self->unhilight);
popup_free(self->popup);
- g_free(self);
+ g_slice_free(ObPagerPopup, self);
}
}