X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Fpopup.c;h=8793accc45ac4dbf9f0f1a1e860afbfdeb074e5f;hb=aeac3b735bf4caf7c014c58c1271b2cbe5aedd80;hp=47d0d0fbca86bdda1f38ff265c5ed36fa0413229;hpb=965ed8907a5dd81d5ffbc93b67a672fa78833854;p=chaz%2Fopenbox diff --git a/openbox/popup.c b/openbox/popup.c index 47d0d0fb..8793accc 100644 --- a/openbox/popup.c +++ b/openbox/popup.c @@ -25,18 +25,18 @@ #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; @@ -72,7 +72,7 @@ void popup_free(ObPopup *self) RrAppearanceFree(self->a_text); window_remove(self->bg); stacking_remove(self); - g_free(self); + g_slice_free(ObPopup, self); } } @@ -158,7 +158,8 @@ void popup_delay_show(ObPopup *self, gulong usec, gchar *text) 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 @@ -259,8 +260,6 @@ void popup_delay_show(ObPopup *self, gulong usec, gchar *text) 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); @@ -270,8 +269,6 @@ void popup_delay_show(ObPopup *self, gulong usec, gchar *text) 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 */ @@ -342,7 +339,7 @@ ObIconPopup *icon_popup_new(void) { 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, @@ -364,7 +361,7 @@ void icon_popup_free(ObIconPopup *self) XDestroyWindow(obt_display, self->icon); RrAppearanceFree(self->a_icon); popup_free(self->popup); - g_free(self); + g_slice_free(ObIconPopup, self); } } @@ -501,13 +498,13 @@ ObPagerPopup *pager_popup_new(void) { 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; @@ -527,7 +524,7 @@ void pager_popup_free(ObPagerPopup *self) RrAppearanceFree(self->hilight); RrAppearanceFree(self->unhilight); popup_free(self->popup); - g_free(self); + g_slice_free(ObPagerPopup, self); } }