X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=spectrwm.c;h=3b240f1052965fbd9531e37a1eb69ee0c1726f45;hb=1fa17c86c27db076578a215f9393663c083644cd;hp=f4ab936f4e6893b706eee702bbc97d6476a1b9b8;hpb=5e2b9113a98ce3991cf8971ec3db75cae812df3e;p=spectrwm.git diff --git a/spectrwm.c b/spectrwm.c index f4ab936..3b240f1 100644 --- a/spectrwm.c +++ b/spectrwm.c @@ -1992,8 +1992,9 @@ bar_setup(struct swm_region *r) xcb_create_pixmap(conn, screen->root_depth, r->bar->buffer, r->bar->id, WIDTH(r->bar), HEIGHT(r->bar)); - xcb_randr_select_input(conn, r->bar->id, - XCB_RANDR_NOTIFY_MASK_OUTPUT_CHANGE); + if (xrandr_support) + xcb_randr_select_input(conn, r->bar->id, + XCB_RANDR_NOTIFY_MASK_OUTPUT_CHANGE); if (bar_enabled) map_window_raised(r->bar->id); @@ -7406,6 +7407,7 @@ clientmessage(xcb_client_message_event_t *e) xcb_flush(conn); } +#ifdef XCB_CONN_ERROR void check_conn(void) { @@ -7435,6 +7437,14 @@ check_conn(void) if (err) errx(err, "X CONNECTION ERROR: %s", s); } +#else +void +check_conn(void) +{ + if (conn->has_error) + errx(1, "X CONNECTION ERROR"); +} +#endif int enable_wm(void) @@ -7739,17 +7749,17 @@ setup_screens(void) /* initial Xrandr setup */ xrandr_support = 0; - c = xcb_randr_query_version(conn, 1, 1); - r = xcb_randr_query_version_reply(conn, c, NULL); - if (r) { - if (r->major_version >= 1) { - qep = xcb_get_extension_data(conn, &xcb_randr_id); - if (qep) { + qep = xcb_get_extension_data(conn, &xcb_randr_id); + if (qep->present) { + c = xcb_randr_query_version(conn, 1, 1); + r = xcb_randr_query_version_reply(conn, c, NULL); + if (r) { + if (r->major_version >= 1) { xrandr_support = 1; xrandr_eventbase = qep->first_event; } + free(r); } - free(r); } cursor_font = xcb_generate_id(conn);