]> Dogcows Code - chaz/openbox/blobdiff - openbox/actions/desktop.c
show a popup notification when switching desktops (also make all the config options...
[chaz/openbox] / openbox / actions / desktop.c
index 3132a4fc253573453ab0107162de6b4a8b15caea..75949be2e5fc2d1c40622f07e87a75b676a2a461 100644 (file)
@@ -21,12 +21,12 @@ typedef struct {
             gboolean wrap;
             ObDirection dir;
         } rel;
-    }
+    };
     gboolean send;
     gboolean follow;
 } Options;
 
-static gpointer setup_switch_func(ObParseInst *i, xmlDocPtr doc,
+static gpointer setup_go_func(ObParseInst *i, xmlDocPtr doc,
                                   xmlNodePtr node);
 static gpointer setup_send_func(ObParseInst *i, xmlDocPtr doc,
                                 xmlNodePtr node);
@@ -34,13 +34,13 @@ static gboolean run_func(ObActionsData *data, gpointer options);
 
 void action_desktop_startup()
 {
-    actions_register("SwitchToDesktop", setup_switch_func, g_free, run_func,
+    actions_register("GoToDesktop", setup_go_func, g_free, run_func,
                      NULL, NULL);
     actions_register("SendToDesktop", setup_send_func, g_free, run_func,
                      NULL, NULL);
 }
 
-static gpointer setup_switch_func(ObParseInst *i, xmlDocPtr doc,
+static gpointer setup_go_func(ObParseInst *i, xmlDocPtr doc,
                                   xmlNodePtr node)
 {
     xmlNodePtr n;
@@ -55,8 +55,7 @@ static gpointer setup_switch_func(ObParseInst *i, xmlDocPtr doc,
 
     if ((n = parse_find_node("to", node))) {
         gchar *s = parse_string(doc, n);
-        if (!g_ascii_strcasecmp(s, "last") ||
-            !g_ascii_strcasecmp(s, "previous"))
+        if (!g_ascii_strcasecmp(s, "last"))
             o->type = LAST;
         else if (!g_ascii_strcasecmp(s, "next")) {
             o->type = RELATIVE;
@@ -104,7 +103,10 @@ static gpointer setup_switch_func(ObParseInst *i, xmlDocPtr doc,
 static gpointer setup_send_func(ObParseInst *i, xmlDocPtr doc,
                                 xmlNodePtr node)
 {
-    Options *o = setup_switch_func(i, doc, node);
+    xmlNodePtr n;
+    Options *o;
+
+    o = setup_go_func(i, doc, node);
     o->send = TRUE;
     o->follow = TRUE;
 
@@ -120,7 +122,7 @@ static gboolean run_func(ObActionsData *data, gpointer options)
     Options *o = options;
     guint d;
 
-    
+
 
     switch (o->type) {
     case LAST:
@@ -130,10 +132,8 @@ static gboolean run_func(ObActionsData *data, gpointer options)
         d = o->abs.desktop;
         break;
     case RELATIVE:
-        d = screen_cycle_desktop(o->abs.dir,
-                                 o->abs.wrap,
-                                 o->abs.linear,
-                                 FALSE, TRUE, FALSE);
+        d = screen_find_desktop(screen_desktop,
+                                o->rel.dir, o->rel.wrap, o->rel.linear);
         break;
     }
 
This page took 0.02769 seconds and 4 git commands to generate.