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:
16
src/match.c
16
src/match.c
@ -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 {
|
||||
|
Reference in New Issue
Block a user