summaryrefslogtreecommitdiff
path: root/openbox/menuframe.c
diff options
context:
space:
mode:
authorMikael Magnusson <mikachu@gmail.com>2010-04-16 17:58:20 +0200
committerDana Jansens <danakj@orodu.net>2011-08-01 11:53:29 -0400
commit588aa0790abd0bf6452843c0e3490482e90b3654 (patch)
treeb8c5b5bbf7dcf6aa1605ee811dd9a492d2180637 /openbox/menuframe.c
parent6ad5f085fa5a38ab8373769cac5cd52839d0a7a5 (diff)
Allow setting icons for submenus
Diffstat (limited to 'openbox/menuframe.c')
-rw-r--r--openbox/menuframe.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/openbox/menuframe.c b/openbox/menuframe.c
index e6fc53ab..6110045c 100644
--- a/openbox/menuframe.c
+++ b/openbox/menuframe.c
@@ -181,7 +181,8 @@ static ObMenuEntryFrame* menu_entry_frame_new(ObMenuEntry *entry,
self->text = createWindow(self->window, 0, NULL);
g_hash_table_insert(menu_frame_map, &self->window, self);
g_hash_table_insert(menu_frame_map, &self->text, self);
- if (entry->type == OB_MENU_ENTRY_TYPE_NORMAL) {
+ if ((entry->type == OB_MENU_ENTRY_TYPE_NORMAL) ||
+ (entry->type == OB_MENU_ENTRY_TYPE_SUBMENU)) {
self->icon = createWindow(self->window, 0, NULL);
g_hash_table_insert(menu_frame_map, &self->icon, self);
}
@@ -209,7 +210,8 @@ static void menu_entry_frame_free(ObMenuEntryFrame *self)
XDestroyWindow(obt_display, self->window);
g_hash_table_remove(menu_frame_map, &self->text);
g_hash_table_remove(menu_frame_map, &self->window);
- if (self->entry->type == OB_MENU_ENTRY_TYPE_NORMAL) {
+ if ((self->entry->type == OB_MENU_ENTRY_TYPE_NORMAL) ||
+ (self->entry->type == OB_MENU_ENTRY_TYPE_SUBMENU)) {
XDestroyWindow(obt_display, self->icon);
g_hash_table_remove(menu_frame_map, &self->icon);
}
@@ -522,7 +524,8 @@ static void menu_entry_frame_render(ObMenuEntryFrame *self)
g_assert_not_reached();
}
- if (self->entry->type == OB_MENU_ENTRY_TYPE_NORMAL &&
+ if (((self->entry->type == OB_MENU_ENTRY_TYPE_NORMAL) ||
+ (self->entry->type == OB_MENU_ENTRY_TYPE_SUBMENU)) &&
self->entry->data.normal.icon)
{
RrAppearance *clear;