summaryrefslogtreecommitdiff
path: root/openbox
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2007-04-25 18:26:02 +0000
committerDana Jansens <danakj@orodu.net>2007-04-25 18:26:02 +0000
commitb5dbe857db4d691b5a909a1e596f15cdc80c633a (patch)
treed7602f0b0f4cba0610b4f774e0996b98b40f7a4e /openbox
parent0c41ab3c208970a68e9d0e0d0471c450542e23a3 (diff)
dont go to disabled menu entries with keyboard shortcuts
fix some rendering of shortcuts
Diffstat (limited to 'openbox')
-rw-r--r--openbox/event.c3
-rw-r--r--openbox/menuframe.c9
2 files changed, 8 insertions, 4 deletions
diff --git a/openbox/event.c b/openbox/event.c
index 4a60194b..10b7816c 100644
--- a/openbox/event.c
+++ b/openbox/event.c
@@ -1331,7 +1331,8 @@ static void event_handle_menu_shortcut(XEvent *ev)
ObMenuEntryFrame *e = it->data;
gunichar entrykey = 0;
- if (e->entry->type == OB_MENU_ENTRY_TYPE_NORMAL)
+ if (e->entry->type == OB_MENU_ENTRY_TYPE_NORMAL &&
+ e->entry->data.normal.enabled)
entrykey = e->entry->data.normal.shortcut;
else if (e->entry->type == OB_MENU_ENTRY_TYPE_SUBMENU)
entrykey = e->entry->data.submenu.submenu->shortcut;
diff --git a/openbox/menuframe.c b/openbox/menuframe.c
index 9d635f95..7ca2136c 100644
--- a/openbox/menuframe.c
+++ b/openbox/menuframe.c
@@ -318,8 +318,9 @@ static void menu_entry_frame_render(ObMenuEntryFrame *self)
self->a_text_selected :
self->a_text_normal));
text_a->texture[0].data.text.string = self->entry->data.normal.label;
- if (self->frame->menu->show_all_shortcuts ||
- self->entry->data.normal.shortcut > 0)
+ if (self->entry->data.normal.shortcut &&
+ (self->frame->menu->show_all_shortcuts ||
+ self->entry->data.normal.shortcut_position > 0))
{
text_a->texture[0].data.text.shortcut = TRUE;
text_a->texture[0].data.text.shortcut_pos =
@@ -333,7 +334,9 @@ static void menu_entry_frame_render(ObMenuEntryFrame *self)
self->a_text_normal);
sub = self->entry->data.submenu.submenu;
text_a->texture[0].data.text.string = sub ? sub->title : "";
- if (self->frame->menu->show_all_shortcuts || sub->shortcut > 0) {
+ if (sub->shortcut && (self->frame->menu->show_all_shortcuts ||
+ sub->shortcut_position > 0))
+ {
text_a->texture[0].data.text.shortcut = TRUE;
text_a->texture[0].data.text.shortcut_pos = sub->shortcut_position;
} else