summaryrefslogtreecommitdiff
path: root/openbox/client_menu.c
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2007-05-07 23:38:10 +0000
committerDana Jansens <danakj@orodu.net>2007-05-07 23:38:10 +0000
commitfa332cc31474cf1337a0aba5b7d2e9bdd028d87c (patch)
tree8c8155b25cb75da72f5f7ac1ac3ba80cdf2408e0 /openbox/client_menu.c
parent280529221e9349aa07c6c498df6b80b3a8951198 (diff)
try reselect the same line. its not perfect though..
Diffstat (limited to 'openbox/client_menu.c')
-rw-r--r--openbox/client_menu.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/openbox/client_menu.c b/openbox/client_menu.c
index acb52530..8375d396 100644
--- a/openbox/client_menu.c
+++ b/openbox/client_menu.c
@@ -178,8 +178,19 @@ static void desktop_change_callback(ObClient *c, gpointer data)
if (frame->parent) {
ObMenuEntryFrame *me = frame->parent_entry;
ObMenuFrame *parent = frame->parent;
+ gint sel =
+ g_list_position(frame->entries,
+ g_list_find(frame->entries, frame->selected));
menu_frame_select(parent, NULL, TRUE);
menu_frame_select(parent, me, TRUE);
+
+ frame = parent->child;
+ /* reselect the same spot or the last one if it got shorter */
+ sel = MIN(sel, (gint)g_list_length(frame->entries));
+ if (sel >= 0)
+ menu_frame_select(frame,
+ g_list_nth(frame->entries, sel)->data,
+ TRUE);
} else
menu_frame_hide(frame);
}