Skip to content

Commit

Permalink
utils/process: initialize the used x extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
absolutelynothelix committed Oct 18, 2024
1 parent a723772 commit 16617af
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion src/utils/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,30 @@ int spawn_picomling(struct x_connection *c) {
setsid();

x_connection_init_xcb(c, new_c, screen);
xcb_prefetch_extension_data(c->c, &xcb_render_id);

xcb_prefetch_extension_data(c->c, &xcb_randr_id);
xcb_prefetch_extension_data(c->c, &xcb_render_id);

// Initialize the X RandR extension.
auto extension = xcb_get_extension_data(c->c, &xcb_randr_id);
if (!extension || !extension->present) {
log_error("The X server doesn't have the X RandR extension.");

return -1;
}

c->e.has_randr = true;
c->e.randr_event = extension->first_event;

// Initialize the X Render extension.
extension = xcb_get_extension_data(c->c, &xcb_render_id);
if (!extension || !extension->present) {
log_error("The X server doesn't have the X Render extension.");

return -1;
}

c->e.render_error = extension->first_error;

return 0;
}

0 comments on commit 16617af

Please sign in to comment.