Check if con_id exists in cmd_swap (#2898)
Also adds some testcases for swap using con_id. Fixes #2895
This commit is contained in:
committed by
Michael Stapelberg
parent
85eb097677
commit
66f2148236
16
src/con.c
16
src/con.c
@ -557,6 +557,22 @@ Con *con_by_window_id(xcb_window_t window) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* Returns the container with the given container ID or NULL if no such
|
||||
* container exists.
|
||||
*
|
||||
*/
|
||||
Con *con_by_con_id(long target) {
|
||||
Con *con;
|
||||
TAILQ_FOREACH(con, &all_cons, all_cons) {
|
||||
if (con == (Con *)target) {
|
||||
return con;
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* Returns the container with the given frame ID or NULL if no such container
|
||||
* exists.
|
||||
|
Reference in New Issue
Block a user