add the DesktopLast action, props to marius nita for this one
authorDana Jansens <danakj@orodu.net>
Sun, 31 Aug 2003 20:06:42 +0000 (20:06 +0000)
committerDana Jansens <danakj@orodu.net>
Sun, 31 Aug 2003 20:06:42 +0000 (20:06 +0000)
openbox/action.c
openbox/action.h
openbox/screen.c
openbox/screen.h

index c5c0e7e..d24e81e 100644 (file)
@@ -595,6 +595,11 @@ ActionString actionstrings[] =
         NULL
     },
     {
+        "desktoplast",
+        action_desktop_last,
+        NULL
+    },
+    {
         "restart",
         action_restart,
         NULL
@@ -1052,6 +1057,11 @@ void action_send_to_desktop_dir(union ActionData *data)
         screen_set_desktop(d);
 }
 
+void action_desktop_last(union ActionData *data)
+{
+    screen_set_desktop(screen_last_desktop);
+}
+
 void action_toggle_decorations(union ActionData *data)
 {
     ObClient *c = data->client.any.c;
index 1b8f215..3f6d84e 100644 (file)
@@ -214,6 +214,8 @@ void action_send_to_desktop_dir(union ActionData *data);
 void action_desktop(union ActionData *data);
 /* DesktopDirection */
 void action_desktop_dir(union ActionData *data);
+/* Any */
+void action_desktop_last(union ActionData *data);
 /* ClientAction */
 void action_toggle_decorations(union ActionData *data);
 /* MoveResize */
index 6f711ce..3809e05 100644 (file)
@@ -36,6 +36,7 @@
 guint    screen_num_desktops;
 guint    screen_num_monitors;
 guint    screen_desktop;
+guint    screen_last_desktop;
 Size     screen_physical_size;
 gboolean screen_showing_desktop;
 DesktopLayout screen_desktop_layout;
@@ -420,6 +421,8 @@ void screen_set_desktop(guint num)
 
     if (old == num) return;
 
+    screen_last_desktop = old;
+
     ob_debug("Moving to desktop %d\n", num+1);
 
     /* show windows before hiding the rest to lessen the enter/leave events */
index bd47496..1484207 100644 (file)
@@ -14,6 +14,8 @@ extern guint screen_num_desktops;
 extern guint screen_num_monitors;
 /*! The current desktop */
 extern guint screen_desktop;
+/*! The desktop which was last visible */
+extern guint screen_last_desktop;
 /*! Are we in showing-desktop mode? */
 extern gboolean screen_showing_desktop;
 /*! The support window also used for focus and stacking */