diff options
| -rw-r--r-- | src/defs.h | 1 | ||||
| -rw-r--r-- | src/parser.c | 3 | ||||
| -rw-r--r-- | src/sxwm.c | 9 |
3 files changed, 11 insertions, 2 deletions
@@ -160,6 +160,7 @@ extern void resize_win_down(void); extern void resize_win_left(void); extern void resize_win_right(void); extern void resize_win_up(void); +extern void switch_previous_workspace(void); extern void toggle_floating(void); extern void toggle_floating_global(void); extern void toggle_fullscreen(void); diff --git a/src/parser.c b/src/parser.c index d48f084..a479705 100644 --- a/src/parser.c +++ b/src/parser.c @@ -48,7 +48,8 @@ static const CommandEntry call_table[] = { {"global_floating", toggle_floating_global}, {"fullscreen", toggle_fullscreen}, {"centre_window", centre_window}, - {NULL, NULL} + {"switch_previous_workspace", switch_previous_workspace}, + {NULL, NULL}, }; static void remap_and_dedupe_binds(Config *cfg) @@ -116,6 +116,7 @@ void spawn(const char * const *argv); void startup_exec(void); void swallow_window(Client *swallower, Client *swallowed); void swap_clients(Client *a, Client *b); +/* void switch_previous_workspace(void); */ void tile(void); /* void toggle_floating(void); */ /* void toggle_floating_global(void); */ @@ -191,12 +192,12 @@ Scratchpad scratchpads[MAX_SCRATCHPADS]; int scratchpad_count = 0; int current_scratchpad = 0; int n_mons = 0; +int previous_workspace = 0; int current_ws = 0; int current_mon = 0; Bool global_floating = False; Bool in_ws_switch = False; Bool running = False; -Bool next_should_float = False; long last_motion_time = 0; Mask numlock_mask = 0; @@ -396,6 +397,7 @@ void change_workspace(int ws) } } + previous_workspace = current_ws; current_ws = ws; for (Client *c = workspaces[current_ws]; c; c = c->next) { if (c->mapped) { @@ -2637,6 +2639,11 @@ void swap_clients(Client *a, Client *b) ta->next = tb_next == ta ? tb : tb_next; } +void switch_previous_workspace(void) +{ + change_workspace(previous_workspace); +} + void tile(void) { update_struts(); |
