aboutsummaryrefslogtreecommitdiffstats
path: root/sway
diff options
context:
space:
mode:
authorLibravatar taiyu <taiyu.len@gmail.com>2015-08-22 18:25:05 -0700
committerLibravatar taiyu <taiyu.len@gmail.com>2015-08-22 18:25:05 -0700
commit36cd180f02cf032fa1d041540fff236061c3df5a (patch)
tree20c4c2a290a17aac05472fafc2eab0f1724bf298 /sway
parentFix minor bug with output positioning (diff)
downloadsway-36cd180f02cf032fa1d041540fff236061c3df5a.tar.gz
sway-36cd180f02cf032fa1d041540fff236061c3df5a.tar.zst
sway-36cd180f02cf032fa1d041540fff236061c3df5a.zip
fixed vanishing floating view
Diffstat (limited to 'sway')
-rw-r--r--sway/container.c17
-rw-r--r--sway/focus.c1
2 files changed, 10 insertions, 8 deletions
diff --git a/sway/container.c b/sway/container.c
index 67a34551..127e1ecd 100644
--- a/sway/container.c
+++ b/sway/container.c
@@ -299,7 +299,8 @@ swayc_t *destroy_workspace(swayc_t *workspace) {
299 return NULL; 299 return NULL;
300 } 300 }
301 301
302 if (workspace->children->length == 0) { 302 // Do not destroy if there are children
303 if (workspace->children->length == 0 && workspace->floating->length == 0) {
303 sway_log(L_DEBUG, "%s: '%s'", __func__, workspace->name); 304 sway_log(L_DEBUG, "%s: '%s'", __func__, workspace->name);
304 swayc_t *parent = workspace->parent; 305 swayc_t *parent = workspace->parent;
305 free_swayc(workspace); 306 free_swayc(workspace);
@@ -466,14 +467,16 @@ bool swayc_is_fullscreen(swayc_t *view) {
466// Mapping 467// Mapping
467 468
468void container_map(swayc_t *container, void (*f)(swayc_t *view, void *data), void *data) { 469void container_map(swayc_t *container, void (*f)(swayc_t *view, void *data), void *data) {
469 if (container && container->children && container->children->length) { 470 if (container) {
470 int i; 471 int i;
471 for (i = 0; i < container->children->length; ++i) { 472 if (container->children) {
472 swayc_t *child = container->children->items[i]; 473 for (i = 0; i < container->children->length; ++i) {
473 f(child, data); 474 swayc_t *child = container->children->items[i];
474 container_map(child, f, data); 475 f(child, data);
476 container_map(child, f, data);
477 }
475 } 478 }
476 if (container->type == C_WORKSPACE) { 479 if (container->floating) {
477 for (i = 0; i < container->floating->length; ++i) { 480 for (i = 0; i < container->floating->length; ++i) {
478 swayc_t *child = container->floating->items[i]; 481 swayc_t *child = container->floating->items[i];
479 f(child, data); 482 f(child, data);
diff --git a/sway/focus.c b/sway/focus.c
index a3e5e77a..e369de30 100644
--- a/sway/focus.c
+++ b/sway/focus.c
@@ -34,7 +34,6 @@ static void update_focus(swayc_t *c) {
34 mask = 2; 34 mask = 2;
35 container_map(c, set_view_visibility, &mask); 35 container_map(c, set_view_visibility, &mask);
36 wlc_output_set_mask(parent->handle, 2); 36 wlc_output_set_mask(parent->handle, 2);
37 c->parent->focused = c;
38 destroy_workspace(ws); 37 destroy_workspace(ws);
39 } 38 }
40 break; 39 break;