mirror of https://github.com/yshui/picom.git
Check for connection error in x_new_id
This commit is contained in:
parent
a2f816acb1
commit
33539976ef
3
src/x.h
3
src/x.h
|
@ -75,6 +75,9 @@ struct xvisual_info {
|
||||||
|
|
||||||
/// Wraps x_new_id. abort the program if x_new_id returns error
|
/// Wraps x_new_id. abort the program if x_new_id returns error
|
||||||
static inline uint32_t x_new_id(xcb_connection_t *c) {
|
static inline uint32_t x_new_id(xcb_connection_t *c) {
|
||||||
|
if (xcb_connection_has_error(c)) {
|
||||||
|
log_fatal("We had a connection error");
|
||||||
|
}
|
||||||
auto ret = xcb_generate_id(c);
|
auto ret = xcb_generate_id(c);
|
||||||
if (ret == (uint32_t)-1) {
|
if (ret == (uint32_t)-1) {
|
||||||
log_fatal("We seems to have run of XIDs. This is either a bug in the X "
|
log_fatal("We seems to have run of XIDs. This is either a bug in the X "
|
||||||
|
|
Loading…
Reference in New Issue