]> Dogcows Code - chaz/openbox/blobdiff - openbox/client_list_menu.c
make openbox base-dir spec compliant, and change the theme dir structure, so that...
[chaz/openbox] / openbox / client_list_menu.c
index c176a989ae5ee847e40d069df2a40535a8aadf9e..9b904f4dc6fe6c184d926a5c772e160206812548 100644 (file)
@@ -17,14 +17,13 @@ typedef struct {
     guint desktop;
 } DesktopData;
 
-void plugin_setup_config() { }
-
 static void desk_menu_update(ObMenuFrame *frame, gpointer data)
 {
     ObMenu *menu = frame->menu;
     DesktopData *d = data;
     GList *it;
     gint i;
+    gboolean icons = FALSE;
 
     menu_clear_entries(menu);
 
@@ -36,8 +35,14 @@ static void desk_menu_update(ObMenuFrame *frame, gpointer data)
             ObMenuEntry *e;
             ObClientIcon *icon;
 
-            act = action_from_string("activate");
-            act->data.activate.c = c;
+            if (!icons && c->iconic) {
+                icons = TRUE;
+                menu_add_separator(menu, -1);
+            }
+
+            act = action_from_string("Activate",
+                                     OB_USER_ACTION_MENU_SELECTION);
+            act->data.activate.any.c = c;
             acts = g_slist_prepend(NULL, act);
             e = menu_add_normal(menu, i,
                                 (c->iconic ? c->icon_title : c->title), acts);
@@ -52,16 +57,16 @@ static void desk_menu_update(ObMenuFrame *frame, gpointer data)
     
 }
 
-/* executes it without changing the client in the actions, since we set that
+/* executes it using the client in the actions, since we set that
    when we make the actions! */
-static void desk_menu_execute(ObMenuEntry *self, gpointer data)
+static void desk_menu_execute(ObMenuEntry *self, guint state, gpointer data)
 {
     GSList *it;
 
     for (it = self->data.normal.actions; it; it = g_slist_next(it))
     {
         ObAction *act = it->data;
-        act->func(&act->data);
+        action_run(it->data, act->data.any.c, state);
     }
 }
 
@@ -70,6 +75,8 @@ static void desk_menu_destroy(ObMenu *menu, gpointer data)
     DesktopData *d = data;
 
     g_free(d);
+
+    desktop_menus = g_slist_remove(desktop_menus, menu);
 }
 
 static void self_update(ObMenuFrame *frame, gpointer data)
This page took 0.025581 seconds and 4 git commands to generate.