summaryrefslogtreecommitdiff
path: root/src/sxwm.c
diff options
context:
space:
mode:
authorAbhinav Prasai <abhinav.prsai@gmail.com>2025-10-06 18:46:17 +0100
committerAbhinav Prasai <abhinav.prsai@gmail.com>2025-10-06 18:46:17 +0100
commit1e221771eaa18f31401a4fbe1781fbb4f78c2608 (patch)
treec75d0a9661b08dc20433edb88cb824da78ca73a4 /src/sxwm.c
parent55072d9876efbefdd3fa3d73cf122e32aa0b981a (diff)
add switch to previous workspace
Diffstat (limited to 'src/sxwm.c')
-rw-r--r--src/sxwm.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/sxwm.c b/src/sxwm.c
index 19a97dc..f1b38bb 100644
--- a/src/sxwm.c
+++ b/src/sxwm.c
@@ -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();