aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2018-04-06 09:26:28 -0400
committerDrew DeVault <sir@cmpwn.com>2018-04-06 09:26:49 -0400
commitb08f7e5183d25ce0d4ae89796893a6d25d4a1b93 (patch)
tree70b9e3f290fcbdb203a0d2c8911b4da83d326085
parent3499cc6c8702ed1959ead391f4bb54f7a69fe18a (diff)
Fix deletion of still-visible workspaces on unfocus
-rw-r--r--sway/input/seat.c4
-rw-r--r--sway/tree/container.c1
2 files changed, 4 insertions, 1 deletions
diff --git a/sway/input/seat.c b/sway/input/seat.c
index e3df6955..ad3584a0 100644
--- a/sway/input/seat.c
+++ b/sway/input/seat.c
@@ -6,6 +6,7 @@
#include <wlr/types/wlr_output_layout.h>
#include <wlr/types/wlr_xcursor_manager.h>
#include "sway/tree/container.h"
+#include "sway/tree/workspace.h"
#include "sway/input/seat.h"
#include "sway/input/cursor.h"
#include "sway/input/input-manager.h"
@@ -398,7 +399,8 @@ void seat_set_focus_warp(struct sway_seat *seat,
}
if (last_ws) {
ipc_event_workspace(last_ws, container, "focus");
- if (last_ws->children->length == 0) {
+ if (!workspace_is_visible(last_ws)
+ && last_ws->children->length == 0) {
container_destroy(last_ws);
}
}
diff --git a/sway/tree/container.c b/sway/tree/container.c
index 41321dc8..ab8363bc 100644
--- a/sway/tree/container.c
+++ b/sway/tree/container.c
@@ -216,6 +216,7 @@ static bool container_reap_empty(struct sway_container *con) {
break;
case C_WORKSPACE:
if (!workspace_is_visible(con) && con->children->length == 0) {
+ wlr_log(L_DEBUG, "Destroying workspace via reaper");
container_workspace_destroy(con);
return true;
}