Remove the layout undo/redo code which never really worked.

This commit is contained in:
Nicholas Marriott
2013-01-17 00:11:22 +00:00
parent 44f8e1caff
commit e33ba57c13
8 changed files with 12 additions and 148 deletions

View File

@@ -29,8 +29,8 @@ enum cmd_retval cmd_select_layout_exec(struct cmd *, struct cmd_ctx *);
const struct cmd_entry cmd_select_layout_entry = {
"select-layout", "selectl",
"nprut:", 0, 1,
"[-npUu] " CMD_TARGET_WINDOW_USAGE " [layout-name]",
"npt:", 0, 1,
"[-np] " CMD_TARGET_WINDOW_USAGE " [layout-name]",
0,
cmd_select_layout_key_binding,
NULL,
@@ -76,14 +76,6 @@ cmd_select_layout_key_binding(struct cmd *self, int key)
case '5' | KEYC_ESCAPE:
self->args = args_create(1, "tiled");
break;
case 'u':
self->args = args_create(0);
args_set(self->args, 'u', NULL);
break;
case 'U':
self->args = args_create(0);
args_set(self->args, 'U', NULL);
break;
default:
self->args = args_create(0);
break;
@@ -110,21 +102,6 @@ cmd_select_layout_exec(struct cmd *self, struct cmd_ctx *ctx)
if (args_has(self->args, 'p'))
previous = 1;
layout_list_add(w);
if (args_has(self->args, 'U')) {
if ((layoutname = layout_list_redo(w)) == NULL) {
ctx->info(ctx, "no more layout history");
return (CMD_RETURN_ERROR);
}
goto set_layout;
} else if (args_has(self->args, 'u')) {
if ((layoutname = layout_list_undo(w)) == NULL) {
ctx->info(ctx, "no more layout history");
return (CMD_RETURN_ERROR);
}
goto set_layout;
}
if (next || previous) {
if (next)
layout = layout_set_next(wl->window);
@@ -146,16 +123,14 @@ cmd_select_layout_exec(struct cmd *self, struct cmd_ctx *ctx)
return (CMD_RETURN_NORMAL);
}
if (args->argc == 0)
return (CMD_RETURN_NORMAL);
layoutname = args->argv[0];
set_layout:
if (layout_parse(wl->window, layoutname) == -1) {
ctx->error(ctx, "can't set layout: %s", layoutname);
return (CMD_RETURN_ERROR);
if (args->argc != 0) {
layoutname = args->argv[0];
if (layout_parse(wl->window, layoutname) == -1) {
ctx->error(ctx, "can't set layout: %s", layoutname);
return (CMD_RETURN_ERROR);
}
server_redraw_window(wl->window);
ctx->info(ctx, "arranging in: %s", layoutname);
}
server_redraw_window(wl->window);
ctx->info(ctx, "arranging in: %s", layoutname);
return (CMD_RETURN_NORMAL);
}