Implement 'swap' command.

This patch introduces a new command 'swap' that swaps two containers so
that they assume each other's position and geometry.

fixes #917
This commit is contained in:
Ingo Bürk
2016-02-26 22:39:44 +01:00
parent 9bc504ebdb
commit 5f9a5e8d7d
13 changed files with 794 additions and 46 deletions

View File

@ -307,12 +307,8 @@ void match_parse_property(Match *match, const char *ctype, const char *cvalue) {
return;
}
char *end;
long parsed = strtol(cvalue, &end, 0);
if (parsed == LONG_MIN ||
parsed == LONG_MAX ||
parsed < 0 ||
(end && *end != '\0')) {
long parsed;
if (!parse_long(cvalue, &parsed, 0)) {
ELOG("Could not parse con id \"%s\"\n", cvalue);
match->error = sstrdup("invalid con_id");
} else {
@ -323,12 +319,8 @@ void match_parse_property(Match *match, const char *ctype, const char *cvalue) {
}
if (strcmp(ctype, "id") == 0) {
char *end;
long parsed = strtol(cvalue, &end, 0);
if (parsed == LONG_MIN ||
parsed == LONG_MAX ||
parsed < 0 ||
(end && *end != '\0')) {
long parsed;
if (!parse_long(cvalue, &parsed, 0)) {
ELOG("Could not parse window id \"%s\"\n", cvalue);
match->error = sstrdup("invalid id");
} else {