Added action wrapper for "Cleanup Windows"
authorChristopher Michael <cpmichael1@comcast.net>
Wed, 11 Oct 2006 23:53:39 +0000 (23:53 +0000)
committerChristopher Michael <cpmichael1@comcast.net>
Wed, 11 Oct 2006 23:53:39 +0000 (23:53 +0000)
SVN revision: 26544

src/bin/e_actions.c
src/bin/e_int_menus.c

index 19eb6e5..fc0df17 100644 (file)
@@ -1354,7 +1354,6 @@ ACT_FN_GO_KEY(winlist)
      }
 }
 
-/***************************************************************************/
 ACT_FN_GO(desk_deskshow_toggle)
 {
    E_Zone *zone;
@@ -1367,6 +1366,16 @@ ACT_FN_GO(desk_deskshow_toggle)
      }
 }
 
+ACT_FN_GO(cleanup_windows)
+{
+   E_Zone *zone;
+
+   zone = _e_actions_zone_get(obj);
+   if (!zone) zone = e_util_zone_current_get(e_manager_current_get());
+   if (zone)
+     e_place_zone_region_smart_cleanup(zone);
+}
+
 /***************************************************************************/
 static E_Dialog *exit_dialog = NULL;
 
@@ -2006,6 +2015,10 @@ e_actions_init(void)
    /* desk_lock */
    ACT_GO(desk_lock);
    e_action_predef_name_set(_("Desktop"), _("Desktop Lock"), "desk_lock", NULL, NULL, 0);
+
+   /* cleanup_windows */
+   ACT_GO(cleanup_windows);
+   e_action_predef_name_set(_("Desktop"), _("Cleanup Windows"), "cleanup_windows", NULL, NULL, 0);
    
    return 1;
 }
index 4dc3067..5856584 100644 (file)
@@ -988,10 +988,10 @@ _e_int_menus_clients_icon_cb(void *data, E_Menu *m, E_Menu_Item *mi)
 static void 
 _e_int_menus_clients_cleanup_cb(void *data, E_Menu *m, E_Menu_Item *mi)
 {
-   E_Zone *zone;
-
-   zone = data;
-   e_place_zone_region_smart_cleanup(zone);
+   E_Action *act;
+   
+   act = e_action_find("cleanup_windows");
+   if (act) act->func.go(E_OBJECT(m->zone), NULL);
 }
 
 static void