Allow sending windows on other desktops to the current desktop.
authorMikael Magnusson <mikachu@comhem.se>
Thu, 6 Mar 2008 19:06:38 +0000 (20:06 +0100)
committerDana Jansens <danakj@orodu.net>
Thu, 20 May 2010 21:19:05 +0000 (17:19 -0400)
openbox/actions/desktop.c

index 04b0bdd..9c8d2a7 100644 (file)
@@ -6,6 +6,7 @@
 
 typedef enum {
     LAST,
 
 typedef enum {
     LAST,
+    CURRENT,
     RELATIVE,
     ABSOLUTE
 } SwitchType;
     RELATIVE,
     ABSOLUTE
 } SwitchType;
@@ -168,6 +169,8 @@ static gpointer setup_func(xmlNodePtr node,
         gchar *s = obt_xml_node_string(n);
         if (!g_ascii_strcasecmp(s, "last"))
             o->type = LAST;
         gchar *s = obt_xml_node_string(n);
         if (!g_ascii_strcasecmp(s, "last"))
             o->type = LAST;
+        else if (!g_ascii_strcasecmp(s, "current"))
+            o->type = CURRENT;
         else if (!g_ascii_strcasecmp(s, "next")) {
             o->type = RELATIVE;
             o->u.rel.linear = TRUE;
         else if (!g_ascii_strcasecmp(s, "next")) {
             o->type = RELATIVE;
             o->u.rel.linear = TRUE;
@@ -272,6 +275,9 @@ static gboolean run_func(ObActionsData *data, gpointer options)
     case LAST:
         d = screen_last_desktop;
         break;
     case LAST:
         d = screen_last_desktop;
         break;
+    case CURRENT:
+        d = screen_desktop;
+        break;
     case ABSOLUTE:
         d = o->u.abs.desktop;
         break;
     case ABSOLUTE:
         d = o->u.abs.desktop;
         break;
@@ -283,7 +289,9 @@ static gboolean run_func(ObActionsData *data, gpointer options)
         g_assert_not_reached();
     }
 
         g_assert_not_reached();
     }
 
-    if (d < screen_num_desktops && d != screen_desktop) {
+    if (d < screen_num_desktops &&
+        (d != screen_desktop ||
+         (data->client && data->client->desktop != screen_desktop))) {
         gboolean go = TRUE;
 
         actions_client_move(data, TRUE);
         gboolean go = TRUE;
 
         actions_client_move(data, TRUE);