summaryrefslogtreecommitdiff
path: root/openbox
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2003-08-31 20:06:42 +0000
committerDana Jansens <danakj@orodu.net>2003-08-31 20:06:42 +0000
commit854da68d0f5bed8c85c101fd6895244d60183ff5 (patch)
tree3442c5e09253dfab99abd3f670a9ccf7234dc08c /openbox
parent030fabad14e994d575feba9894a0412e5266f0bb (diff)
add the DesktopLast action, props to marius nita for this one
Diffstat (limited to 'openbox')
-rw-r--r--openbox/action.c10
-rw-r--r--openbox/action.h2
-rw-r--r--openbox/screen.c3
-rw-r--r--openbox/screen.h2
4 files changed, 17 insertions, 0 deletions
diff --git a/openbox/action.c b/openbox/action.c
index c5c0e7ed..d24e81e6 100644
--- a/openbox/action.c
+++ b/openbox/action.c
@@ -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;
diff --git a/openbox/action.h b/openbox/action.h
index 1b8f2156..3f6d84eb 100644
--- a/openbox/action.h
+++ b/openbox/action.h
@@ -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 */
diff --git a/openbox/screen.c b/openbox/screen.c
index 6f711ce8..3809e05a 100644
--- a/openbox/screen.c
+++ b/openbox/screen.c
@@ -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 */
diff --git a/openbox/screen.h b/openbox/screen.h
index bd47496d..1484207a 100644
--- a/openbox/screen.h
+++ b/openbox/screen.h
@@ -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 */