parse_register(menu_parse_inst, "separator",
parse_menu_separator, &parse_state);
parse_tree(menu_parse_inst, doc, node->xmlChildrenNode);
+ xmlFreeDoc(doc);
}
}
for (f = self; f; f = f->parent)
menu_frame_move(f, f->area.x + dx, f->area.y + dy);
+ for (f = self->child; f; f = f->child)
+ menu_frame_move(f, f->area.x + dx, f->area.y + dy);
XWarpPointer(ob_display, None, None, 0, 0, 0, 0, dx, dy);
}
}
void menu_frame_show(ObMenuFrame *self, ObMenuFrame *parent)
{
+ GList *it;
+
+ if (g_list_find(menu_frame_visible, self))
+ return;
+
if (parent) {
if (parent->child)
menu_frame_hide(parent->child);
grab_keyboard(TRUE);
}
- if (!g_list_find(menu_frame_visible, self)) {
- menu_frame_visible = g_list_prepend(menu_frame_visible, self);
-
+ /* determine if the underlying menu is already visible */
+ for (it = menu_frame_visible; it; it = g_list_next(it)) {
+ ObMenuFrame *f = it->data;
+ if (f->menu == self->menu)
+ break;
+ }
+ if (!it) {
if (self->menu->update_func)
self->menu->update_func(self, self->menu->data);
- menu_frame_update(self);
}
+ menu_frame_visible = g_list_prepend(menu_frame_visible, self);
+ menu_frame_update(self);
+
menu_frame_move_on_screen(self);
XMapWindow(ob_display, self->window);
void menu_frame_hide(ObMenuFrame *self)
{
- menu_frame_visible = g_list_remove(menu_frame_visible, self);
+ GList *it = g_list_find(menu_frame_visible, self);
+
+ if (!it)
+ return;
+
+ menu_frame_visible = g_list_delete_link(menu_frame_visible, it);
if (self->child)
menu_frame_hide(self->child);
if (parse_load_rc(&doc, &node))
parse_tree(i, doc, node->xmlChildrenNode);
/* we're done with parsing now, kill it */
+ xmlFreeDoc(doc);
parse_shutdown(i);
menu_parse();
session_shutdown();
g_free(ob_sm_id);
+#ifdef USE_LIBSN
+ sn_display_unref(ob_sn_display);
+#endif
+
XCloseDisplay(ob_display);
if (restart) {
}
XChangeProperty(ob_display, win, prop, prop_atoms.utf8, 8,
PropModeReplace, (guchar*)str->str, str->len);
+ g_string_free(str, TRUE);
}
void prop_erase(Window win, Atom prop)
wm_sn = g_strdup_printf("WM_S%d", ob_screen);
wm_sn_atom = XInternAtom(ob_display, wm_sn, FALSE);
+ g_free(wm_sn);
current_wm_sn_owner = XGetSelectionOwner(ob_display, wm_sn_atom);
if (current_wm_sn_owner) {
void RrColorFree(RrColor *c)
{
if (c) {
+ if (c->pixel) XFreeColors(RrDisplay(c->inst), RrColormap(c->inst),
+ &c->pixel, 1, 0);
if (c->gc) XFreeGC(RrDisplay(c->inst), c->gc);
g_free(c);
}
XftDrawStringUtf8(d, &c, t->font->xftfont, x,
t->font->xftfont->ascent + y,
(FcChar8*)text->str, l);
+
+ g_string_free(text, TRUE);
return;
}
"window.button.toggled.focus",
theme->a_toggled_focused_max,
TRUE))
+ {
+ RrAppearanceFree(theme->a_toggled_focused_max);
theme->a_toggled_focused_max =
RrAppearanceCopy(theme->a_focused_pressed_max);
+ }
if (!read_appearance(db, inst,
"window.button.toggled.unfocus",
theme->a_toggled_unfocused_max,
TRUE))
+ {
+ RrAppearanceFree(theme->a_toggled_unfocused_max);
theme->a_toggled_unfocused_max =
RrAppearanceCopy(theme->a_unfocused_pressed_max);
+ }
if (!read_appearance(db, inst,
"window.button.focus",
theme->a_focused_unpressed_max,
"window.button.hover.focus",
theme->a_hover_focused_max,
TRUE))
+ {
+ RrAppearanceFree(theme->a_hover_focused_max);
theme->a_hover_focused_max =
RrAppearanceCopy(theme->a_focused_unpressed_max);
+ }
if (!read_appearance(db, inst,
"window.button.hover.unfocus",
theme->a_hover_unfocused_max,
TRUE))
+ {
+ RrAppearanceFree(theme->a_hover_unfocused_max);
theme->a_hover_unfocused_max =
RrAppearanceCopy(theme->a_unfocused_unpressed_max);
+ }
theme->a_disabled_focused_close =
RrAppearanceCopy(theme->a_disabled_focused_max);
RrColorFree(theme->menu_title_color);
RrColorFree(theme->menu_disabled_color);
RrColorFree(theme->menu_hilite_color);
+ RrColorFree(theme->menu_bullet_color);
RrPixmapMaskFree(theme->max_mask);
RrPixmapMaskFree(theme->max_toggled_mask);