}
if (strcmp(ctype, "window_role") == 0) {
- current_match->role = regex_new(cvalue);
+ current_match->window_role = regex_new(cvalue);
return;
}
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);
*/
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);
}
/*