mirror of
https://codeberg.org/dnkl/yambar.git
synced 2025-04-23 04:25:42 +02:00
module/xwindow: replace assert with real error check
This commit is contained in:
parent
6d75fe64ef
commit
3af0280304
1 changed files with 5 additions and 1 deletions
|
@ -181,7 +181,11 @@ run(struct module_run_context *ctx)
|
||||||
struct private *m = mod->private;
|
struct private *m = mod->private;
|
||||||
|
|
||||||
m->conn = xcb_connect(NULL, NULL);
|
m->conn = xcb_connect(NULL, NULL);
|
||||||
assert(m->conn != NULL);
|
if (m->conn == NULL) {
|
||||||
|
LOG_ERR("failed to connect to X");
|
||||||
|
module_signal_ready(ctx);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
const xcb_setup_t *setup = xcb_get_setup(m->conn);
|
const xcb_setup_t *setup = xcb_get_setup(m->conn);
|
||||||
xcb_screen_t *screen = xcb_setup_roots_iterator(setup).data;
|
xcb_screen_t *screen = xcb_setup_roots_iterator(setup).data;
|
||||||
|
|
Loading…
Add table
Reference in a new issue