]> git.sur5r.net Git - i3/i3/commitdiff
Merge branch 'master' into next
authorMichael Stapelberg <michael@stapelberg.de>
Sat, 15 Mar 2014 17:05:45 +0000 (18:05 +0100)
committerMichael Stapelberg <michael@stapelberg.de>
Sat, 15 Mar 2014 17:05:45 +0000 (18:05 +0100)
1  2 
src/commands.c

diff --combined src/commands.c
index 7ad3aba013d0c7cbe9900ea4cf8b50af99ad4dab,f73f2bb320e7ca511b2f2843ff7817f34597677a..c0f1d1874a00ff544436ab5b7858f1673437db15
@@@ -339,7 -339,7 +339,7 @@@ void cmd_criteria_add(I3_CMD, char *cty
      }
  
      if (strcmp(ctype, "window_role") == 0) {
 -        current_match->role = regex_new(cvalue);
 +        current_match->window_role = regex_new(cvalue);
          return;
      }
  
@@@ -779,6 -779,12 +779,12 @@@ void cmd_resize(I3_CMD, char *way, cha
  
      owindow *current;
      TAILQ_FOREACH(current, &owindows, owindows) {
+         /* Don't handle dock windows (issue #1201) */
+         if (current->con->window->dock) {
+             DLOG("This is a dock window. Not resizing (con = %p)\n)", current->con);
+             continue;
+         }
          Con *floating_con;
          if ((floating_con = con_inside_floating(current->con))) {
              cmd_resize_floating(current_match, cmd_output, way, direction, floating_con, px);
@@@ -868,31 -874,11 +874,31 @@@ void cmd_nop(I3_CMD, char *comment) 
   */
  void cmd_append_layout(I3_CMD, char *path) {
      LOG("Appending layout \"%s\"\n", path);
 -    tree_append_json(path);
 +    Con *parent = focused;
 +    char *errormsg = NULL;
 +    tree_append_json(path, &errormsg);
 +    if (errormsg != NULL) {
 +        yerror(errormsg);
 +        free(errormsg);
 +        /* Note that we continue executing since tree_append_json() has
 +         * side-effects — user-provided layouts can be partly valid, partly
 +         * invalid, leading to half of the placeholder containers being
 +         * created. */
 +    } else {
 +        ysuccess(true);
 +    }
 +
 +    // XXX: This is a bit of a kludge. Theoretically, render_con(parent,
 +    // false); should be enough, but when sending 'workspace 4; append_layout
 +    // /tmp/foo.json', the needs_tree_render == true of the workspace command
 +    // is not executed yet and will be batched with append_layout’s
 +    // needs_tree_render after the parser finished. We should check if that is
 +    // necessary at all.
 +    render_con(croot, false);
 +
 +    restore_open_placeholder_windows(parent);
  
      cmd_output->needs_tree_render = true;
 -    // XXX: default reply for now, make this a better reply
 -    ysuccess(true);
  }
  
  /*