]> Dogcows Code - chaz/openbox/commitdiff
try reselect the same line. its not perfect though..
authorDana Jansens <danakj@orodu.net>
Mon, 7 May 2007 23:38:10 +0000 (23:38 +0000)
committerDana Jansens <danakj@orodu.net>
Mon, 7 May 2007 23:38:10 +0000 (23:38 +0000)
openbox/client_menu.c

index acb525300ad181f436817e648eebf33919fb00d0..8375d396819bd189937fd00d884786149ad270a9 100644 (file)
@@ -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);
     }
This page took 0.024579 seconds and 4 git commands to generate.