]> Dogcows Code - chaz/openbox/blobdiff - openbox/client_list_menu.c
no more interactive mouse actions, they are evil etc. actions now "feel" much more...
[chaz/openbox] / openbox / client_list_menu.c
index 97c40fe52c9e447450aec8f4b530c37b25952efa..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,7 +35,13 @@ static void desk_menu_update(ObMenuFrame *frame, gpointer data)
             ObMenuEntry *e;
             ObClientIcon *icon;
 
-            act = action_from_string("activate");
+            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,
@@ -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.022718 seconds and 4 git commands to generate.