]> git.lizzy.rs Git - bspwm.git/commitdiff
Merge branch 'master' into focus-history
authorBastien Dejean <nihilhill@gmail.com>
Sun, 3 Mar 2013 09:44:13 +0000 (10:44 +0100)
committerBastien Dejean <nihilhill@gmail.com>
Sun, 3 Mar 2013 09:44:13 +0000 (10:44 +0100)
1  2 
messages.c
tree.c
tree.h
types.c
types.h

diff --cc messages.c
Simple merge
diff --cc tree.c
index 35239dc70897482ffbdb2342bd8eb0b2d05cd1e5,dc27a7487cabe36c03c5f90bfa6ff1b416517d76..1a37be88f075f123755d310bad1c2bc0c6b61755
--- 1/tree.c
--- 2/tree.c
+++ b/tree.c
@@@ -167,16 -167,25 +167,34 @@@ void rotate_tree(node_t *n, rotate_t ro
      rotate_tree(n->second_child, rot);
  }
  
+ void flip_tree(node_t *n, flip_t flp)
+ {
+     if (n == NULL || is_leaf(n))
+         return;
+     node_t *tmp;
+     if ((flp == FLIP_HORIZONTAL && n->split_type == TYPE_HORIZONTAL)
+             || (flp == FLIP_VERTICAL && n->split_type == TYPE_VERTICAL)) {
+         tmp = n->first_child;
+         n->first_child = n->second_child;
+         n->second_child = tmp;
+         n->split_ratio = 1.0 - n->split_ratio;
+     }
+     flip_tree(n->first_child, flp);
+     flip_tree(n->second_child, flp);
+ }
  
 +void list_history(desktop_t *d, char *rsp)
 +{
 +    char line[MAXLEN];
 +    for (node_list_t *a = d->focus_history->head; a != NULL; a = a->prev) {
 +        snprintf(line, sizeof(line), "%s %X\n", a->node->client->class_name, a->node->client->window);
 +        strncat(rsp, line, REMLEN(rsp));
 +    }
 +}
 +
  void arrange(monitor_t *m, desktop_t *d)
  {
      PRINTF("arrange %s%s%s\n", (num_monitors > 1 ? m->name : ""), (num_monitors > 1 ? " " : ""), d->name);
diff --cc tree.h
Simple merge
diff --cc types.c
index f6acef9735f64bd2c1d2d5d40a880d05b8fdda64,9d5eafefd2c59b4f2cb0d6389e1b876c796819cd..38e215800ee45ee94c225e37b5d231030aa29868
+++ b/types.c
@@@ -170,33 -154,10 +170,38 @@@ rule_t *make_rule(void
  pointer_state_t *make_pointer_state(void)
  {
      pointer_state_t *p = malloc(sizeof(pointer_state_t));
+     p->monitor = NULL;
+     p->desktop = NULL;
+     p->node = p->vertical_fence = p->horizontal_fence = NULL;
+     p->client = NULL;
+     p->window = XCB_NONE;
      return p;
  }
 +
 +void history_add(focus_history_t *f, node_t *n)
 +{
 +    node_list_t *a = make_node_list();
 +    a->node = n;
 +    if (f->head == NULL) {
 +        f->head = f->tail = f->position = a;
 +    } else {
 +        f->head->next = a;
 +        a->prev = f->head;
 +        f->head = a;
 +    }
 +}
 +
 +void history_remove(focus_history_t *f, node_t *n)
 +{
 +    for(node_list_t *b = f->head; b != NULL; b = b->prev)
 +        if (b->node == n) {
 +            node_list_t *a = b->prev;
 +            node_list_t *c = b->next;
 +            if (a != NULL)
 +                a->next = c;
 +            if (c != NULL)
 +                c->prev = a;
 +            free(b);
 +            return;
 +        }
 +}
diff --cc types.h
Simple merge