examples: Drop usage of wlr_output.pending

This commit is contained in:
Alexander Orzechowski 2023-06-12 20:16:25 -04:00 committed by Simon Ser
parent 0925a500d1
commit 495bcbeedd
9 changed files with 42 additions and 29 deletions

View file

@ -166,10 +166,11 @@ static void server_handle_new_output(struct wl_listener *listener, void *data) {
struct wlr_output_mode *mode = wlr_output_preferred_mode(wlr_output); struct wlr_output_mode *mode = wlr_output_preferred_mode(wlr_output);
if (mode != NULL) { if (mode != NULL) {
wlr_output_set_mode(wlr_output, mode); struct wlr_output_state state = {0};
wlr_output_state_set_mode(&state, mode);
wlr_output_commit_state(wlr_output, &state);
wlr_output_state_finish(&state);
} }
wlr_output_commit(wlr_output);
} }
static void server_handle_present_surface(struct wl_listener *listener, static void server_handle_present_surface(struct wl_listener *listener,

View file

@ -175,10 +175,12 @@ static void server_handle_new_output(struct wl_listener *listener, void *data) {
wl_signal_add(&wlr_output->events.frame, &output->frame); wl_signal_add(&wlr_output->events.frame, &output->frame);
wl_list_insert(&server->outputs, &output->link); wl_list_insert(&server->outputs, &output->link);
if (!wl_list_empty(&wlr_output->modes)) { struct wlr_output_mode *mode = wlr_output_preferred_mode(wlr_output);
struct wlr_output_mode *mode = wlr_output_preferred_mode(wlr_output); if (mode != NULL) {
wlr_output_set_mode(wlr_output, mode); struct wlr_output_state state = {0};
wlr_output_commit(wlr_output); wlr_output_state_set_mode(&state, mode);
wlr_output_commit_state(wlr_output, &state);
wlr_output_state_finish(&state);
} }
wlr_output_create_global(wlr_output); wlr_output_create_global(wlr_output);

View file

@ -178,10 +178,11 @@ static void new_output_notify(struct wl_listener *listener, void *data) {
struct wlr_output_mode *mode = wlr_output_preferred_mode(output); struct wlr_output_mode *mode = wlr_output_preferred_mode(output);
if (mode != NULL) { if (mode != NULL) {
wlr_output_set_mode(output, mode); struct wlr_output_state state = {0};
wlr_output_state_set_mode(&state, mode);
wlr_output_commit_state(output, &state);
wlr_output_state_finish(&state);
} }
wlr_output_commit(output);
} }
static void keyboard_key_notify(struct wl_listener *listener, void *data) { static void keyboard_key_notify(struct wl_listener *listener, void *data) {

View file

@ -280,10 +280,11 @@ static void new_output_notify(struct wl_listener *listener, void *data) {
struct wlr_output_mode *mode = wlr_output_preferred_mode(output); struct wlr_output_mode *mode = wlr_output_preferred_mode(output);
if (mode != NULL) { if (mode != NULL) {
wlr_output_set_mode(output, mode); struct wlr_output_state state = {0};
wlr_output_state_set_mode(&state, mode);
wlr_output_commit_state(output, &state);
wlr_output_state_finish(&state);
} }
wlr_output_commit(output);
} }

View file

@ -122,7 +122,9 @@ static void new_output_notify(struct wl_listener *listener, void *data) {
sample_output->x_offs = sample_output->y_offs = 0; sample_output->x_offs = sample_output->y_offs = 0;
sample_output->x_vel = sample_output->y_vel = 128; sample_output->x_vel = sample_output->y_vel = 128;
wlr_output_set_transform(output, sample->transform); struct wlr_output_state state = {0};
wlr_output_state_set_transform(&state, sample->transform);
sample_output->output = output; sample_output->output = output;
sample_output->sample = sample; sample_output->sample = sample;
wl_signal_add(&output->events.frame, &sample_output->frame); wl_signal_add(&output->events.frame, &sample_output->frame);
@ -133,10 +135,11 @@ static void new_output_notify(struct wl_listener *listener, void *data) {
struct wlr_output_mode *mode = wlr_output_preferred_mode(output); struct wlr_output_mode *mode = wlr_output_preferred_mode(output);
if (mode != NULL) { if (mode != NULL) {
wlr_output_set_mode(output, mode); wlr_output_state_set_mode(&state, mode);
} }
wlr_output_commit(output); wlr_output_commit_state(output, &state);
wlr_output_state_finish(&state);
} }
static void keyboard_key_notify(struct wl_listener *listener, void *data) { static void keyboard_key_notify(struct wl_listener *listener, void *data) {

View file

@ -81,10 +81,12 @@ static void server_handle_new_output(struct wl_listener *listener, void *data) {
output->scene_output = wlr_scene_output_create(server->scene, wlr_output); output->scene_output = wlr_scene_output_create(server->scene, wlr_output);
if (!wl_list_empty(&wlr_output->modes)) { struct wlr_output_mode *mode = wlr_output_preferred_mode(wlr_output);
struct wlr_output_mode *mode = wlr_output_preferred_mode(wlr_output); if (mode != NULL) {
wlr_output_set_mode(wlr_output, mode); struct wlr_output_state state = {0};
wlr_output_commit(wlr_output); wlr_output_state_set_mode(&state, mode);
wlr_output_commit_state(wlr_output, &state);
wlr_output_state_finish(&state);
} }
wlr_output_create_global(wlr_output); wlr_output_create_global(wlr_output);

View file

@ -107,10 +107,11 @@ static void new_output_notify(struct wl_listener *listener, void *data) {
struct wlr_output_mode *mode = wlr_output_preferred_mode(output); struct wlr_output_mode *mode = wlr_output_preferred_mode(output);
if (mode != NULL) { if (mode != NULL) {
wlr_output_set_mode(output, mode); struct wlr_output_state state = {0};
wlr_output_state_set_mode(&state, mode);
wlr_output_commit_state(sample_output->output, &state);
wlr_output_state_finish(&state);
} }
wlr_output_commit(sample_output->output);
} }
static void keyboard_key_notify(struct wl_listener *listener, void *data) { static void keyboard_key_notify(struct wl_listener *listener, void *data) {

View file

@ -285,10 +285,11 @@ static void new_output_notify(struct wl_listener *listener, void *data) {
struct wlr_output_mode *mode = wlr_output_preferred_mode(output); struct wlr_output_mode *mode = wlr_output_preferred_mode(output);
if (mode != NULL) { if (mode != NULL) {
wlr_output_set_mode(output, mode); struct wlr_output_state state = {0};
wlr_output_state_set_mode(&state, mode);
wlr_output_commit_state(output, &state);
wlr_output_state_finish(&state);
} }
wlr_output_commit(output);
} }
static void keyboard_key_notify(struct wl_listener *listener, void *data) { static void keyboard_key_notify(struct wl_listener *listener, void *data) {

View file

@ -184,10 +184,11 @@ static void new_output_notify(struct wl_listener *listener, void *data) {
struct wlr_output_mode *mode = wlr_output_preferred_mode(output); struct wlr_output_mode *mode = wlr_output_preferred_mode(output);
if (mode != NULL) { if (mode != NULL) {
wlr_output_set_mode(output, mode); struct wlr_output_state state = {0};
wlr_output_state_set_mode(&state, mode);
wlr_output_commit_state(output, &state);
wlr_output_state_finish(&state);
} }
wlr_output_commit(output);
} }
static void keyboard_key_notify(struct wl_listener *listener, void *data) { static void keyboard_key_notify(struct wl_listener *listener, void *data) {