summaryrefslogtreecommitdiff
path: root/openbox/menuframe.c
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2010-01-04 15:26:10 -0500
committerDana Jansens <danakj@orodu.net>2010-01-06 17:13:03 -0500
commite8588737c944f4dc5f94ca67bf0c7e3ff7133004 (patch)
tree2f9c8004128bf03fecd5d9b7e521d7e2f70d6026 /openbox/menuframe.c
parentb88cf22bc0084bc611453443b5d8355edbe33bfa (diff)
Allow infinite delay for submenu show/hide by using a negative value.
Diffstat (limited to 'openbox/menuframe.c')
-rw-r--r--openbox/menuframe.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/openbox/menuframe.c b/openbox/menuframe.c
index 9e8c8918..d8c1691e 100644
--- a/openbox/menuframe.c
+++ b/openbox/menuframe.c
@@ -1160,7 +1160,9 @@ void menu_frame_select(ObMenuFrame *self, ObMenuEntryFrame *entry,
if (entry && entry->entry->type == OB_MENU_ENTRY_TYPE_SEPARATOR)
entry = old;
- if (old == entry) return;
+ if (old == entry && (old->entry->type != OB_MENU_ENTRY_TYPE_SUBMENU ||
+ old == oldchild_entry))
+ return;
/* if the user left this menu but we have a submenu open, move the
selection back to that submenu */
@@ -1187,15 +1189,14 @@ void menu_frame_select(ObMenuFrame *self, ObMenuEntryFrame *entry,
else if (oldchild_entry == old) {
/* The open submenu was selected and is no longer, so hide the
submenu */
- if (!immediate && config_submenu_hide_delay) {
+ if (immediate || config_submenu_hide_delay == 0)
+ menu_frame_hide(oldchild);
+ else if (config_submenu_hide_delay > 0)
ob_main_loop_timeout_add(ob_main_loop,
config_submenu_hide_delay * 1000,
submenu_hide_timeout,
oldchild, g_direct_equal,
NULL);
- }
- else
- menu_frame_hide(oldchild);
}
}
@@ -1206,15 +1207,14 @@ void menu_frame_select(ObMenuFrame *self, ObMenuEntryFrame *entry,
if (oldchild_entry != self->selected &&
self->selected->entry->type == OB_MENU_ENTRY_TYPE_SUBMENU)
{
- if (config_submenu_show_delay && !immediate) {
- /* initiate a new submenu open request */
+ if (immediate || config_submenu_hide_delay == 0)
+ menu_entry_frame_show_submenu(self->selected);
+ else if (config_submenu_hide_delay > 0)
ob_main_loop_timeout_add(ob_main_loop,
config_submenu_show_delay * 1000,
submenu_show_timeout,
self->selected, g_direct_equal,
NULL);
- } else
- menu_entry_frame_show_submenu(self->selected);
}
}
}