Add con_exists function
Checks the all_cons queue and returns true if a given con is found.
This commit is contained in:
parent
8653bfe8d3
commit
2e83d2193e
|
@ -165,6 +165,13 @@ Con *con_by_window_id(xcb_window_t window);
|
||||||
*/
|
*/
|
||||||
Con *con_by_con_id(long target);
|
Con *con_by_con_id(long target);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns true if the given container (still) exists.
|
||||||
|
* This can be used, e.g., to make sure a container hasn't been closed in the meantime.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
bool con_exists(Con *con);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the container with the given frame ID or NULL if no such container
|
* Returns the container with the given frame ID or NULL if no such container
|
||||||
* exists.
|
* exists.
|
||||||
|
|
|
@ -604,6 +604,15 @@ Con *con_by_con_id(long target) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Returns true if the given container (still) exists.
|
||||||
|
* This can be used, e.g., to make sure a container hasn't been closed in the meantime.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
bool con_exists(Con *con) {
|
||||||
|
return con_by_con_id((long)con) != NULL;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Returns the container with the given frame ID or NULL if no such container
|
* Returns the container with the given frame ID or NULL if no such container
|
||||||
* exists.
|
* exists.
|
||||||
|
|
Loading…
Reference in New Issue