mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-22 04:45:58 +01:00
output_event_commit: Remove committed and buffer
The newly introduced state struct can be used to retrieve this.
This commit is contained in:
parent
03e240a7f2
commit
5fb0007e02
8 changed files with 12 additions and 15 deletions
|
@ -224,9 +224,7 @@ struct wlr_output_event_precommit {
|
||||||
|
|
||||||
struct wlr_output_event_commit {
|
struct wlr_output_event_commit {
|
||||||
struct wlr_output *output;
|
struct wlr_output *output;
|
||||||
uint32_t committed; // bitmask of enum wlr_output_state_field
|
|
||||||
struct timespec *when;
|
struct timespec *when;
|
||||||
struct wlr_buffer *buffer; // NULL if no buffer is committed
|
|
||||||
const struct wlr_output_state *state;
|
const struct wlr_output_state *state;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -833,9 +833,7 @@ bool wlr_output_commit_state(struct wlr_output *output,
|
||||||
|
|
||||||
struct wlr_output_event_commit event = {
|
struct wlr_output_event_commit event = {
|
||||||
.output = output,
|
.output = output,
|
||||||
.committed = pending.committed,
|
|
||||||
.when = &now,
|
.when = &now,
|
||||||
.buffer = (pending.committed & WLR_OUTPUT_STATE_BUFFER) ? pending.buffer : NULL,
|
|
||||||
.state = &pending,
|
.state = &pending,
|
||||||
};
|
};
|
||||||
wl_signal_emit_mutable(&output->events.commit, &event);
|
wl_signal_emit_mutable(&output->events.commit, &event);
|
||||||
|
|
|
@ -1265,8 +1265,9 @@ static void scene_output_handle_commit(struct wl_listener *listener, void *data)
|
||||||
struct wlr_scene_output *scene_output = wl_container_of(listener,
|
struct wlr_scene_output *scene_output = wl_container_of(listener,
|
||||||
scene_output, output_commit);
|
scene_output, output_commit);
|
||||||
struct wlr_output_event_commit *event = data;
|
struct wlr_output_event_commit *event = data;
|
||||||
|
const struct wlr_output_state *state = event->state;
|
||||||
|
|
||||||
if (event->committed & (WLR_OUTPUT_STATE_MODE |
|
if (state->committed & (WLR_OUTPUT_STATE_MODE |
|
||||||
WLR_OUTPUT_STATE_TRANSFORM |
|
WLR_OUTPUT_STATE_TRANSFORM |
|
||||||
WLR_OUTPUT_STATE_SCALE |
|
WLR_OUTPUT_STATE_SCALE |
|
||||||
WLR_OUTPUT_STATE_ENABLED)) {
|
WLR_OUTPUT_STATE_ENABLED)) {
|
||||||
|
|
|
@ -566,13 +566,13 @@ static void output_cursor_output_handle_output_commit(
|
||||||
wl_container_of(listener, output_cursor, output_commit);
|
wl_container_of(listener, output_cursor, output_commit);
|
||||||
const struct wlr_output_event_commit *event = data;
|
const struct wlr_output_event_commit *event = data;
|
||||||
|
|
||||||
if (event->committed & WLR_OUTPUT_STATE_SCALE) {
|
if (event->state->committed & WLR_OUTPUT_STATE_SCALE) {
|
||||||
cursor_output_cursor_update(output_cursor);
|
cursor_output_cursor_update(output_cursor);
|
||||||
}
|
}
|
||||||
|
|
||||||
struct wlr_surface *surface = output_cursor->cursor->state->surface;
|
struct wlr_surface *surface = output_cursor->cursor->state->surface;
|
||||||
if (surface && output_cursor->output_cursor->visible &&
|
if (surface && output_cursor->output_cursor->visible &&
|
||||||
(event->committed & WLR_OUTPUT_STATE_BUFFER)) {
|
(event->state->committed & WLR_OUTPUT_STATE_BUFFER)) {
|
||||||
wlr_surface_send_frame_done(surface, event->when);
|
wlr_surface_send_frame_done(surface, event->when);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -57,7 +57,7 @@ static void frame_output_handle_commit(struct wl_listener *listener,
|
||||||
wl_container_of(listener, frame, output_commit);
|
wl_container_of(listener, frame, output_commit);
|
||||||
struct wlr_output_event_commit *event = data;
|
struct wlr_output_event_commit *event = data;
|
||||||
|
|
||||||
if (!(event->committed & WLR_OUTPUT_STATE_BUFFER)) {
|
if (!(event->state->committed & WLR_OUTPUT_STATE_BUFFER)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -65,7 +65,7 @@ static void frame_output_handle_commit(struct wl_listener *listener,
|
||||||
wl_list_init(&frame->output_commit.link);
|
wl_list_init(&frame->output_commit.link);
|
||||||
|
|
||||||
struct wlr_dmabuf_attributes attribs = {0};
|
struct wlr_dmabuf_attributes attribs = {0};
|
||||||
if (!wlr_buffer_get_dmabuf(event->buffer, &attribs)) {
|
if (!wlr_buffer_get_dmabuf(event->state->buffer, &attribs)) {
|
||||||
zwlr_export_dmabuf_frame_v1_send_cancel(frame->resource,
|
zwlr_export_dmabuf_frame_v1_send_cancel(frame->resource,
|
||||||
ZWLR_EXPORT_DMABUF_FRAME_V1_CANCEL_REASON_TEMPORARY);
|
ZWLR_EXPORT_DMABUF_FRAME_V1_CANCEL_REASON_TEMPORARY);
|
||||||
frame_destroy(frame);
|
frame_destroy(frame);
|
||||||
|
|
|
@ -118,7 +118,8 @@ static void handle_output_commit(struct wl_listener *listener, void *data) {
|
||||||
wl_container_of(listener, l_output, commit);
|
wl_container_of(listener, l_output, commit);
|
||||||
struct wlr_output_event_commit *event = data;
|
struct wlr_output_event_commit *event = data;
|
||||||
|
|
||||||
if (event->committed & (WLR_OUTPUT_STATE_SCALE | WLR_OUTPUT_STATE_TRANSFORM |
|
if (event->state->committed & (WLR_OUTPUT_STATE_SCALE |
|
||||||
|
WLR_OUTPUT_STATE_TRANSFORM |
|
||||||
WLR_OUTPUT_STATE_MODE)) {
|
WLR_OUTPUT_STATE_MODE)) {
|
||||||
output_layout_reconfigure(l_output->layout);
|
output_layout_reconfigure(l_output->layout);
|
||||||
output_update_global(l_output->output);
|
output_update_global(l_output->output);
|
||||||
|
|
|
@ -62,7 +62,7 @@ static void output_power_handle_output_commit(struct wl_listener *listener,
|
||||||
struct wlr_output_power_v1 *output_power =
|
struct wlr_output_power_v1 *output_power =
|
||||||
wl_container_of(listener, output_power, output_commit_listener);
|
wl_container_of(listener, output_power, output_commit_listener);
|
||||||
struct wlr_output_event_commit *event = data;
|
struct wlr_output_event_commit *event = data;
|
||||||
if (event->committed & WLR_OUTPUT_STATE_ENABLED) {
|
if (event->state->committed & WLR_OUTPUT_STATE_ENABLED) {
|
||||||
output_power_v1_send_mode(output_power);
|
output_power_v1_send_mode(output_power);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -272,10 +272,9 @@ static void frame_handle_output_commit(struct wl_listener *listener,
|
||||||
struct wlr_output_event_commit *event = data;
|
struct wlr_output_event_commit *event = data;
|
||||||
struct wlr_output *output = frame->output;
|
struct wlr_output *output = frame->output;
|
||||||
struct wlr_renderer *renderer = output->renderer;
|
struct wlr_renderer *renderer = output->renderer;
|
||||||
struct wlr_buffer *buffer = event->buffer;
|
|
||||||
assert(renderer);
|
assert(renderer);
|
||||||
|
|
||||||
if (!(event->committed & WLR_OUTPUT_STATE_BUFFER)) {
|
if (!(event->state->committed & WLR_OUTPUT_STATE_BUFFER)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -297,10 +296,10 @@ static void frame_handle_output_commit(struct wl_listener *listener,
|
||||||
bool ok;
|
bool ok;
|
||||||
switch (frame->buffer_cap) {
|
switch (frame->buffer_cap) {
|
||||||
case WLR_BUFFER_CAP_DMABUF:
|
case WLR_BUFFER_CAP_DMABUF:
|
||||||
ok = frame_dma_copy(frame, buffer);
|
ok = frame_dma_copy(frame, event->state->buffer);
|
||||||
break;
|
break;
|
||||||
case WLR_BUFFER_CAP_DATA_PTR:
|
case WLR_BUFFER_CAP_DATA_PTR:
|
||||||
ok = frame_shm_copy(frame, buffer);
|
ok = frame_shm_copy(frame, event->state->buffer);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
abort(); // unreachable
|
abort(); // unreachable
|
||||||
|
|
Loading…
Reference in a new issue