diff options
author | Drew DeVault <sir@cmpwn.com> | 2017-12-11 08:32:18 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-11 08:32:18 -0500 |
commit | 808ab5aa1bd990776ae30d5f9bb171ca7b42d6ef (patch) | |
tree | dbed215e4f235d2458cbab2bbff512dcad0f11a2 /backend/x11 | |
parent | 301850ec5d1a65aed87734583ed0868694f1913a (diff) | |
parent | 529675b7b04a2598f7701d2e05567d8249ea1cfb (diff) |
Merge pull request #481 from emersion/custom-mode
Add wlr_output_set_custom_mode
Diffstat (limited to 'backend/x11')
-rw-r--r-- | backend/x11/backend.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/backend/x11/backend.c b/backend/x11/backend.c index b798daf6..5fb54ffd 100644 --- a/backend/x11/backend.c +++ b/backend/x11/backend.c @@ -267,8 +267,8 @@ static bool wlr_x11_backend_start(struct wlr_backend *backend) { snprintf(output->wlr_output.name, sizeof(output->wlr_output.name), "X11-1"); output->win = xcb_generate_id(x11->xcb_conn); - xcb_create_window(x11->xcb_conn, XCB_COPY_FROM_PARENT, output->win, x11->screen->root, - 0, 0, 1024, 768, 1, XCB_WINDOW_CLASS_INPUT_OUTPUT, + xcb_create_window(x11->xcb_conn, XCB_COPY_FROM_PARENT, output->win, + x11->screen->root, 0, 0, 1024, 768, 1, XCB_WINDOW_CLASS_INPUT_OUTPUT, x11->screen->root_visual, mask, values); output->surf = wlr_egl_create_surface(&x11->egl, &output->win); @@ -329,6 +329,17 @@ static struct wlr_backend_impl backend_impl = { .get_egl = wlr_x11_backend_get_egl, }; +static bool output_set_custom_mode(struct wlr_output *wlr_output, int32_t width, + int32_t height, int32_t refresh) { + struct wlr_x11_output *output = (struct wlr_x11_output *)wlr_output; + struct wlr_x11_backend *x11 = output->x11; + + const uint32_t values[] = { width, height }; + xcb_configure_window(x11->xcb_conn, output->win, + XCB_CONFIG_WINDOW_WIDTH | XCB_CONFIG_WINDOW_HEIGHT, values); + return true; +} + static void output_transform(struct wlr_output *wlr_output, enum wl_output_transform transform) { struct wlr_x11_output *output = (struct wlr_x11_output *)wlr_output; output->wlr_output.transform = transform; @@ -362,6 +373,7 @@ static void output_swap_buffers(struct wlr_output *wlr_output) { } static struct wlr_output_impl output_impl = { + .set_custom_mode = output_set_custom_mode, .transform = output_transform, .destroy = output_destroy, .make_current = output_make_current, |