aboutsummaryrefslogtreecommitdiff
path: root/sway/input
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2018-03-30 10:31:21 -0400
committerDrew DeVault <sir@cmpwn.com>2018-03-30 10:47:19 -0400
commit01af34391267e91461a4ab7a1234dd58f45d2c93 (patch)
treeae5197dabda270035b383d45b5c113afab2ebfbd /sway/input
parent2d460502812093b47f43295cf21636198e44edbb (diff)
Destroy empty workspaces when moving away
Diffstat (limited to 'sway/input')
-rw-r--r--sway/input/seat.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sway/input/seat.c b/sway/input/seat.c
index 7cf0dd08..ae536264 100644
--- a/sway/input/seat.c
+++ b/sway/input/seat.c
@@ -8,6 +8,7 @@
#include "sway/input/keyboard.h"
#include "sway/ipc-server.h"
#include "sway/output.h"
+#include "sway/tree/container.h"
#include "sway/tree/view.h"
#include "log.h"
@@ -331,6 +332,9 @@ void sway_seat_set_focus(struct sway_seat *seat, struct sway_container *containe
if (last_ws) {
wlr_log(L_DEBUG, "sending workspace event");
ipc_event_workspace(last_ws, container, "focus");
+ if (last_ws->children->length == 0) {
+ container_workspace_destroy(last_ws);
+ }
}
}