summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar taiyu <taiyu.len@gmail.com>2018-03-27 21:34:55 -0700
committerLibravatar taiyu <taiyu.len@gmail.com>2018-03-27 21:34:55 -0700
commit52b9a62b31f1bcd97bb30044c38b85cd554b56d0 (patch)
tree8de6a857f201e695f383a7a61ebddf9dd6b9b592
parentMerge pull request #1639 from taiyu-len/save_errno (diff)
downloadsway-52b9a62b31f1bcd97bb30044c38b85cd554b56d0.tar.gz
sway-52b9a62b31f1bcd97bb30044c38b85cd554b56d0.tar.zst
sway-52b9a62b31f1bcd97bb30044c38b85cd554b56d0.zip
fix remove_view_from_scratchpad
-rw-r--r--sway/commands.c2
-rw-r--r--sway/container.c3
-rw-r--r--sway/debug_log.c5
3 files changed, 9 insertions, 1 deletions
diff --git a/sway/commands.c b/sway/commands.c
index c7dbf731..fb3653a2 100644
--- a/sway/commands.c
+++ b/sway/commands.c
@@ -141,12 +141,12 @@ void remove_view_from_scratchpad(swayc_t *view) {
141 int i; 141 int i;
142 for (i = 0; i < scratchpad->length; i++) { 142 for (i = 0; i < scratchpad->length; i++) {
143 if (scratchpad->items[i] == view) { 143 if (scratchpad->items[i] == view) {
144 list_del(scratchpad, sp_index);
144 if (sp_index == 0) { 145 if (sp_index == 0) {
145 sp_index = scratchpad->length - 1; 146 sp_index = scratchpad->length - 1;
146 } else { 147 } else {
147 sp_index--; 148 sp_index--;
148 } 149 }
149 list_del(scratchpad, sp_index);
150 sp_view = NULL; 150 sp_view = NULL;
151 } 151 }
152 } 152 }
diff --git a/sway/container.c b/sway/container.c
index 829fde69..9fb044a7 100644
--- a/sway/container.c
+++ b/sway/container.c
@@ -869,6 +869,9 @@ void container_map(swayc_t *container, void (*f)(swayc_t *view, void *data), voi
869void update_visibility_output(swayc_t *container, wlc_handle output) { 869void update_visibility_output(swayc_t *container, wlc_handle output) {
870 // Inherit visibility 870 // Inherit visibility
871 swayc_t *parent = container->parent; 871 swayc_t *parent = container->parent;
872 if (parent == NULL) {
873 return;
874 }
872 container->visible = parent->visible; 875 container->visible = parent->visible;
873 // special cases where visibility depends on focus 876 // special cases where visibility depends on focus
874 if (parent->type == C_OUTPUT || parent->layout == L_TABBED || 877 if (parent->type == C_OUTPUT || parent->layout == L_TABBED ||
diff --git a/sway/debug_log.c b/sway/debug_log.c
index d1eafae8..5cc5f9dc 100644
--- a/sway/debug_log.c
+++ b/sway/debug_log.c
@@ -72,6 +72,11 @@ void layout_log(const swayc_t *c, int depth) {
72 } 72 }
73 } 73 }
74 } 74 }
75 if (c->type == C_ROOT) {
76 fprintf(stderr,"ScratchPad\n");
77 for (int i = 0; i < scratchpad->length; ++i)
78 container_log(scratchpad->items[i], 0);
79 }
75} 80}
76 81
77const char *swayc_type_string(enum swayc_types type) { 82const char *swayc_type_string(enum swayc_types type) {