diff options
author | Alexander Orzechowski <alex@ozal.ski> | 2023-08-16 11:35:28 -0400 |
---|---|---|
committer | Alexander Orzechowski <alex@ozal.ski> | 2023-08-16 11:46:27 -0400 |
commit | 6cda3e251c8f78a376b3a239c2c4fd7fae1a3f3e (patch) | |
tree | 9584cd1e9cf3828c1aa97660c22d921759952498 | |
parent | 8f67446cc736be1c10ff48e83dda3e98ae816dc2 (diff) |
output: Add initialization state to wlr_output_init
-rw-r--r-- | backend/drm/drm.c | 2 | ||||
-rw-r--r-- | backend/headless/output.c | 2 | ||||
-rw-r--r-- | backend/wayland/output.c | 2 | ||||
-rw-r--r-- | backend/x11/output.c | 2 | ||||
-rw-r--r-- | include/wlr/interfaces/wlr_output.h | 3 | ||||
-rw-r--r-- | types/output/output.c | 7 |
6 files changed, 12 insertions, 6 deletions
diff --git a/backend/drm/drm.c b/backend/drm/drm.c index 5e334545..bf6d0bd5 100644 --- a/backend/drm/drm.c +++ b/backend/drm/drm.c @@ -1373,7 +1373,7 @@ static bool connect_drm_connector(struct wlr_drm_connector *wlr_conn, wlr_conn->crtc ? (int)wlr_conn->crtc->id : -1); wlr_output_init(&wlr_conn->output, &drm->backend, &output_impl, - drm->display); + drm->display, NULL); wlr_output_set_name(&wlr_conn->output, wlr_conn->name); diff --git a/backend/headless/output.c b/backend/headless/output.c index 9cac54d1..12bededc 100644 --- a/backend/headless/output.c +++ b/backend/headless/output.c @@ -121,7 +121,7 @@ struct wlr_output *wlr_headless_add_output(struct wlr_backend *wlr_backend, } output->backend = backend; wlr_output_init(&output->wlr_output, &backend->backend, &output_impl, - backend->display); + backend->display, NULL); struct wlr_output *wlr_output = &output->wlr_output; output_set_custom_mode(output, width, height, 0); diff --git a/backend/wayland/output.c b/backend/wayland/output.c index 24b3ff03..6d221285 100644 --- a/backend/wayland/output.c +++ b/backend/wayland/output.c @@ -765,7 +765,7 @@ static struct wlr_wl_output *output_create(struct wlr_wl_backend *backend, return NULL; } wlr_output_init(&output->wlr_output, &backend->backend, &output_impl, - backend->local_display); + backend->local_display, NULL); struct wlr_output *wlr_output = &output->wlr_output; wlr_output_update_custom_mode(wlr_output, 1280, 720, 0); diff --git a/backend/x11/output.c b/backend/x11/output.c index 2d433f81..81cb5961 100644 --- a/backend/x11/output.c +++ b/backend/x11/output.c @@ -539,7 +539,7 @@ struct wlr_output *wlr_x11_output_create(struct wlr_backend *backend) { pixman_region32_init(&output->exposed); struct wlr_output *wlr_output = &output->wlr_output; - wlr_output_init(wlr_output, &x11->backend, &output_impl, x11->wl_display); + wlr_output_init(wlr_output, &x11->backend, &output_impl, x11->wl_display, NULL); wlr_output_update_custom_mode(wlr_output, 1024, 768, 0); diff --git a/include/wlr/interfaces/wlr_output.h b/include/wlr/interfaces/wlr_output.h index 6c0bbd6c..42374328 100644 --- a/include/wlr/interfaces/wlr_output.h +++ b/include/wlr/interfaces/wlr_output.h @@ -101,7 +101,8 @@ struct wlr_output_impl { * Initialize a new output. */ void wlr_output_init(struct wlr_output *output, struct wlr_backend *backend, - const struct wlr_output_impl *impl, struct wl_display *display); + const struct wlr_output_impl *impl, struct wl_display *display, + const struct wlr_output_state *state); /** * Update the current output mode. * diff --git a/types/output/output.c b/types/output/output.c index b08ca51a..b92d482b 100644 --- a/types/output/output.c +++ b/types/output/output.c @@ -414,7 +414,8 @@ static void output_apply_state(struct wlr_output *output, } void wlr_output_init(struct wlr_output *output, struct wlr_backend *backend, - const struct wlr_output_impl *impl, struct wl_display *display) { + const struct wlr_output_impl *impl, struct wl_display *display, + const struct wlr_output_state *state) { assert(impl->commit); if (impl->set_cursor || impl->move_cursor) { assert(impl->set_cursor && impl->move_cursor); @@ -455,6 +456,10 @@ void wlr_output_init(struct wlr_output *output, struct wlr_backend *backend, output->display_destroy.notify = handle_display_destroy; wl_display_add_destroy_listener(display, &output->display_destroy); + + if (state) { + output_apply_state(output, state); + } } void wlr_output_destroy(struct wlr_output *output) { |