Switch XComposite initialisation to XCB
Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
parent
8064eaaa37
commit
2f49f6f03d
2
Makefile
2
Makefile
|
@ -9,7 +9,7 @@ MANDIR ?= $(PREFIX)/share/man/man1
|
|||
APPDIR ?= $(PREFIX)/share/applications
|
||||
ICODIR ?= $(PREFIX)/share/icons/hicolor/
|
||||
|
||||
PACKAGES = x11 x11-xcb xcb-renderutil xcb-render xcb-damage xcb-randr xcb-composite xcb-image xcomposite xfixes xext
|
||||
PACKAGES = x11 x11-xcb xcb-renderutil xcb-render xcb-damage xcb-randr xcb-composite xcb-image xfixes xext
|
||||
LIBS = -lm -lrt
|
||||
INCS =
|
||||
|
||||
|
|
|
@ -5362,6 +5362,7 @@ session_init(session_t *ps_old, int argc, char **argv) {
|
|||
ps->root_height = DisplayHeight(ps->dpy, ps->scr);
|
||||
|
||||
xcb_prefetch_extension_data(c, &xcb_render_id);
|
||||
xcb_prefetch_extension_data(c, &xcb_composite_id);
|
||||
xcb_prefetch_extension_data(c, &xcb_damage_id);
|
||||
xcb_prefetch_extension_data(c, &xcb_randr_id);
|
||||
|
||||
|
@ -5373,21 +5374,26 @@ session_init(session_t *ps_old, int argc, char **argv) {
|
|||
ps->render_event = ext_info->first_event;
|
||||
ps->render_error = ext_info->first_error;
|
||||
|
||||
if (!XQueryExtension(ps->dpy, COMPOSITE_NAME, &ps->composite_opcode,
|
||||
&ps->composite_event, &ps->composite_error)) {
|
||||
ext_info = xcb_get_extension_data(c, &xcb_composite_id);
|
||||
if (!ext_info || !ext_info->present) {
|
||||
fprintf(stderr, "No composite extension\n");
|
||||
exit(1);
|
||||
}
|
||||
ps->composite_opcode = ext_info->major_opcode;
|
||||
ps->composite_event = ext_info->first_event;
|
||||
ps->composite_error = ext_info->first_error;
|
||||
|
||||
{
|
||||
int composite_major = 0, composite_minor = 0;
|
||||
|
||||
XCompositeQueryVersion(ps->dpy, &composite_major, &composite_minor);
|
||||
xcb_composite_query_version_reply_t *reply =
|
||||
xcb_composite_query_version_reply(c,
|
||||
xcb_composite_query_version(c, XCB_COMPOSITE_MAJOR_VERSION, XCB_COMPOSITE_MINOR_VERSION),
|
||||
NULL);
|
||||
|
||||
if (!ps->o.no_name_pixmap
|
||||
&& (composite_major > 0 || composite_minor >= 2)) {
|
||||
&& reply && (reply->major_version > 0 || reply->minor_version >= 2)) {
|
||||
ps->has_name_pixmap = true;
|
||||
}
|
||||
free(reply);
|
||||
}
|
||||
|
||||
ext_info = xcb_get_extension_data(c, &xcb_damage_id);
|
||||
|
|
Loading…
Reference in New Issue