slight fix

This commit is contained in:
taiyu 2015-08-26 16:50:47 -07:00
parent 274e56a602
commit 4df64127e9
3 changed files with 25 additions and 5 deletions

View file

@ -366,6 +366,7 @@ static bool cmd_move(struct sway_config *config, int argc, char **argv) {
return false; return false;
} }
// TODO handle case of workspace, something similar to _do_split
if (view->type != C_CONTAINER && view->type != C_VIEW) { if (view->type != C_CONTAINER && view->type != C_VIEW) {
return false; return false;
} }

View file

@ -524,6 +524,19 @@ void set_view_visibility(swayc_t *view, void *data) {
if (!ASSERT_NONNULL(view)) { if (!ASSERT_NONNULL(view)) {
return; return;
} }
// TODO add something like this.
// if (container->type == C_ROOT) {
// container->visible = true;
// } else {
// // Inherit visibility
// swayc_t *parent = container->parent;
// container->visible = parent->visible;
// // special cases where visibility depends on focus
// if (parent->type == C_OUTPUT || parent->layout == L_TABBED ||
// parent->layout == L_STACKED) {
// container->visible = parent->focused == container;
// }
// }
bool visible = *(bool *)data; bool visible = *(bool *)data;
if (view->type == C_VIEW) { if (view->type == C_VIEW) {
wlc_view_set_output(view->handle, swayc_parent_by_type(view, C_OUTPUT)->handle); wlc_view_set_output(view->handle, swayc_parent_by_type(view, C_OUTPUT)->handle);

View file

@ -19,6 +19,7 @@ void init_layout(void) {
root_container.layout = L_NONE; root_container.layout = L_NONE;
root_container.children = create_list(); root_container.children = create_list();
root_container.handle = -1; root_container.handle = -1;
root_container.visible = true;
} }
int index_child(const swayc_t *child) { int index_child(const swayc_t *child) {
@ -238,11 +239,16 @@ void move_container_to(swayc_t* container, swayc_t* destination) {
// Destroy old container if we need to // Destroy old container if we need to
parent = destroy_container(parent); parent = destroy_container(parent);
// Refocus // Refocus
set_focused_container(get_focused_view(&root_container)); swayc_t *op1 = swayc_parent_by_type(destination, C_OUTPUT);
update_visibility(container); swayc_t *op2 = swayc_parent_by_type(parent, C_OUTPUT);
update_visibility(parent); set_focused_container(get_focused_view(op1));
arrange_windows(parent, -1, -1); arrange_windows(op1, -1, -1);
arrange_windows(destination->parent, -1, -1); update_visibility(op1);
if (op1 != op2) {
set_focused_container(get_focused_view(op2));
arrange_windows(op2, -1, -1);
update_visibility(op2);
}
} }
void update_geometry(swayc_t *container) { void update_geometry(swayc_t *container) {