aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar taiyu <taiyu.len@gmail.com>2015-08-26 16:50:47 -0700
committerLibravatar taiyu <taiyu.len@gmail.com>2015-08-26 16:50:47 -0700
commit4df64127e951cb6f13d65fc667c10ffc0f4a4dbd (patch)
tree23a2689b9f15d52d3d8893743671f0fd30586698
parentfixed move_container bug, log prints before aborting (diff)
downloadsway-4df64127e951cb6f13d65fc667c10ffc0f4a4dbd.tar.gz
sway-4df64127e951cb6f13d65fc667c10ffc0f4a4dbd.tar.zst
sway-4df64127e951cb6f13d65fc667c10ffc0f4a4dbd.zip
slight fix
-rw-r--r--sway/commands.c1
-rw-r--r--sway/container.c13
-rw-r--r--sway/layout.c16
3 files changed, 25 insertions, 5 deletions
diff --git a/sway/commands.c b/sway/commands.c
index 2bdfeff6..df48724a 100644
--- a/sway/commands.c
+++ b/sway/commands.c
@@ -366,6 +366,7 @@ static bool cmd_move(struct sway_config *config, int argc, char **argv) {
366 return false; 366 return false;
367 } 367 }
368 368
369 // TODO handle case of workspace, something similar to _do_split
369 if (view->type != C_CONTAINER && view->type != C_VIEW) { 370 if (view->type != C_CONTAINER && view->type != C_VIEW) {
370 return false; 371 return false;
371 } 372 }
diff --git a/sway/container.c b/sway/container.c
index fda90e5b..3558809a 100644
--- a/sway/container.c
+++ b/sway/container.c
@@ -524,6 +524,19 @@ void set_view_visibility(swayc_t *view, void *data) {
524 if (!ASSERT_NONNULL(view)) { 524 if (!ASSERT_NONNULL(view)) {
525 return; 525 return;
526 } 526 }
527 // TODO add something like this.
528// if (container->type == C_ROOT) {
529// container->visible = true;
530// } else {
531// // Inherit visibility
532// swayc_t *parent = container->parent;
533// container->visible = parent->visible;
534// // special cases where visibility depends on focus
535// if (parent->type == C_OUTPUT || parent->layout == L_TABBED ||
536// parent->layout == L_STACKED) {
537// container->visible = parent->focused == container;
538// }
539// }
527 bool visible = *(bool *)data; 540 bool visible = *(bool *)data;
528 if (view->type == C_VIEW) { 541 if (view->type == C_VIEW) {
529 wlc_view_set_output(view->handle, swayc_parent_by_type(view, C_OUTPUT)->handle); 542 wlc_view_set_output(view->handle, swayc_parent_by_type(view, C_OUTPUT)->handle);
diff --git a/sway/layout.c b/sway/layout.c
index 4fdf7b51..5ade5e63 100644
--- a/sway/layout.c
+++ b/sway/layout.c
@@ -19,6 +19,7 @@ void init_layout(void) {
19 root_container.layout = L_NONE; 19 root_container.layout = L_NONE;
20 root_container.children = create_list(); 20 root_container.children = create_list();
21 root_container.handle = -1; 21 root_container.handle = -1;
22 root_container.visible = true;
22} 23}
23 24
24int index_child(const swayc_t *child) { 25int index_child(const swayc_t *child) {
@@ -238,11 +239,16 @@ void move_container_to(swayc_t* container, swayc_t* destination) {
238 // Destroy old container if we need to 239 // Destroy old container if we need to
239 parent = destroy_container(parent); 240 parent = destroy_container(parent);
240 // Refocus 241 // Refocus
241 set_focused_container(get_focused_view(&root_container)); 242 swayc_t *op1 = swayc_parent_by_type(destination, C_OUTPUT);
242 update_visibility(container); 243 swayc_t *op2 = swayc_parent_by_type(parent, C_OUTPUT);
243 update_visibility(parent); 244 set_focused_container(get_focused_view(op1));
244 arrange_windows(parent, -1, -1); 245 arrange_windows(op1, -1, -1);
245 arrange_windows(destination->parent, -1, -1); 246 update_visibility(op1);
247 if (op1 != op2) {
248 set_focused_container(get_focused_view(op2));
249 arrange_windows(op2, -1, -1);
250 update_visibility(op2);
251 }
246} 252}
247 253
248void update_geometry(swayc_t *container) { 254void update_geometry(swayc_t *container) {