mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-22 21:05:58 +01:00
commit
d8bbdf3bd5
2 changed files with 11 additions and 2 deletions
|
@ -258,12 +258,13 @@ struct wlr_backend *wlr_x11_backend_create(struct wl_display *display,
|
||||||
|
|
||||||
int fd = xcb_get_file_descriptor(x11->xcb_conn);
|
int fd = xcb_get_file_descriptor(x11->xcb_conn);
|
||||||
struct wl_event_loop *ev = wl_display_get_event_loop(display);
|
struct wl_event_loop *ev = wl_display_get_event_loop(display);
|
||||||
int events = WL_EVENT_READABLE | WL_EVENT_ERROR | WL_EVENT_HANGUP;
|
uint32_t events = WL_EVENT_READABLE | WL_EVENT_ERROR | WL_EVENT_HANGUP;
|
||||||
x11->event_source = wl_event_loop_add_fd(ev, fd, events, x11_event, x11);
|
x11->event_source = wl_event_loop_add_fd(ev, fd, events, x11_event, x11);
|
||||||
if (!x11->event_source) {
|
if (!x11->event_source) {
|
||||||
wlr_log(WLR_ERROR, "Could not create event source");
|
wlr_log(WLR_ERROR, "Could not create event source");
|
||||||
goto error_display;
|
goto error_display;
|
||||||
}
|
}
|
||||||
|
wl_event_source_check(x11->event_source);
|
||||||
|
|
||||||
x11->screen = xcb_setup_roots_iterator(xcb_get_setup(x11->xcb_conn)).data;
|
x11->screen = xcb_setup_roots_iterator(xcb_get_setup(x11->xcb_conn)).data;
|
||||||
|
|
||||||
|
|
|
@ -47,8 +47,16 @@ static bool output_set_custom_mode(struct wlr_output *wlr_output,
|
||||||
output_set_refresh(&output->wlr_output, refresh);
|
output_set_refresh(&output->wlr_output, refresh);
|
||||||
|
|
||||||
const uint32_t values[] = { width, height };
|
const uint32_t values[] = { width, height };
|
||||||
xcb_configure_window(x11->xcb_conn, output->win,
|
xcb_void_cookie_t cookie = xcb_configure_window_checked(x11->xcb_conn, output->win,
|
||||||
XCB_CONFIG_WINDOW_WIDTH | XCB_CONFIG_WINDOW_HEIGHT, values);
|
XCB_CONFIG_WINDOW_WIDTH | XCB_CONFIG_WINDOW_HEIGHT, values);
|
||||||
|
|
||||||
|
xcb_generic_error_t *error;
|
||||||
|
if ((error = xcb_request_check(x11->xcb_conn, cookie))) {
|
||||||
|
wlr_log(WLR_ERROR, "Could not set window size to %dx%d\n", width, height);
|
||||||
|
free(error);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue