]> Dogcows Code - chaz/openbox/blobdiff - openbox/actions/desktop.c
Remove double newlines.
[chaz/openbox] / openbox / actions / desktop.c
index 0e9ad7399d192fd0b8dce391e6a4be7dac6145e5..bc70748ba49ae9eb3184ffc8be24d557f56d9e28 100644 (file)
@@ -32,7 +32,7 @@ static gpointer setup_send_func(ObParseInst *i, xmlDocPtr doc,
                                 xmlNodePtr node);
 static gboolean run_func(ObActionsData *data, gpointer options);
 
-void action_desktop_startup()
+void action_desktop_startup(void)
 {
     actions_register("GoToDesktop", setup_go_func, g_free, run_func,
                      NULL, NULL);
@@ -55,8 +55,7 @@ static gpointer setup_go_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;
@@ -90,7 +89,7 @@ static gpointer setup_go_func(ObParseInst *i, xmlDocPtr doc,
         }
         else {
             o->type = ABSOLUTE;
-            o->abs.desktop = parse_int(doc, n) - 1;
+            o->abs.desktop = atoi(s) - 1;
         }
         g_free(s);
     }
@@ -123,8 +122,6 @@ static gboolean run_func(ObActionsData *data, gpointer options)
     Options *o = options;
     guint d;
 
-    
-
     switch (o->type) {
     case LAST:
         d = screen_last_desktop;
@@ -133,22 +130,22 @@ static gboolean run_func(ObActionsData *data, gpointer options)
         d = o->abs.desktop;
         break;
     case RELATIVE:
-        d = screen_cycle_desktop(o->rel.dir,
-                                 o->rel.wrap,
-                                 o->rel.linear,
-                                 FALSE, TRUE, FALSE);
+        d = screen_find_desktop(screen_desktop,
+                                o->rel.dir, o->rel.wrap, o->rel.linear);
         break;
     }
 
     if (d < screen_num_desktops && d != screen_desktop) {
         gboolean go = TRUE;
 
+        actions_client_move(data, TRUE);
         if (o->send && data->client && client_normal(data->client)) {
             client_set_desktop(data->client, d, o->follow, FALSE);
             go = o->follow;
         }
 
         if (go) screen_set_desktop(d, TRUE);
+        actions_client_move(data, FALSE);
     }
     return FALSE;
 }
This page took 0.021699 seconds and 4 git commands to generate.