aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorAlexander Orzechowski <alex@ozal.ski>2023-06-12 20:16:25 -0400
committerSimon Ser <contact@emersion.fr>2023-06-13 09:19:51 +0000
commit495bcbeedde21eaa9d68ceef1fba5109d5d50dee (patch)
treea091b0e173e8950b2608836fe12e0c5959d188de /examples
parent0925a500d1b4709a6058b2d1174a5aab90a5e34e (diff)
examples: Drop usage of wlr_output.pending
Diffstat (limited to 'examples')
-rw-r--r--examples/fullscreen-shell.c7
-rw-r--r--examples/output-layers.c10
-rw-r--r--examples/output-layout.c7
-rw-r--r--examples/pointer.c7
-rw-r--r--examples/rotation.c9
-rw-r--r--examples/scene-graph.c10
-rw-r--r--examples/simple.c7
-rw-r--r--examples/tablet.c7
-rw-r--r--examples/touch.c7
9 files changed, 42 insertions, 29 deletions
diff --git a/examples/fullscreen-shell.c b/examples/fullscreen-shell.c
index cf6023b0..9800a4c2 100644
--- a/examples/fullscreen-shell.c
+++ b/examples/fullscreen-shell.c
@@ -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);
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,
diff --git a/examples/output-layers.c b/examples/output-layers.c
index 535b9f5f..973633d4 100644
--- a/examples/output-layers.c
+++ b/examples/output-layers.c
@@ -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_list_insert(&server->outputs, &output->link);
- if (!wl_list_empty(&wlr_output->modes)) {
- struct wlr_output_mode *mode = wlr_output_preferred_mode(wlr_output);
- wlr_output_set_mode(wlr_output, mode);
- wlr_output_commit(wlr_output);
+ struct wlr_output_mode *mode = wlr_output_preferred_mode(wlr_output);
+ if (mode != NULL) {
+ 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_create_global(wlr_output);
diff --git a/examples/output-layout.c b/examples/output-layout.c
index 1094141c..ee45c9c2 100644
--- a/examples/output-layout.c
+++ b/examples/output-layout.c
@@ -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);
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) {
diff --git a/examples/pointer.c b/examples/pointer.c
index 2e116b88..c67ce1ca 100644
--- a/examples/pointer.c
+++ b/examples/pointer.c
@@ -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);
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);
}
diff --git a/examples/rotation.c b/examples/rotation.c
index 31768886..c7bd85ae 100644
--- a/examples/rotation.c
+++ b/examples/rotation.c
@@ -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_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->sample = sample;
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);
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) {
diff --git a/examples/scene-graph.c b/examples/scene-graph.c
index 3d75164b..68441c11 100644
--- a/examples/scene-graph.c
+++ b/examples/scene-graph.c
@@ -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);
- if (!wl_list_empty(&wlr_output->modes)) {
- struct wlr_output_mode *mode = wlr_output_preferred_mode(wlr_output);
- wlr_output_set_mode(wlr_output, mode);
- wlr_output_commit(wlr_output);
+ struct wlr_output_mode *mode = wlr_output_preferred_mode(wlr_output);
+ if (mode != NULL) {
+ 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_create_global(wlr_output);
diff --git a/examples/simple.c b/examples/simple.c
index 0c737106..fa52bce5 100644
--- a/examples/simple.c
+++ b/examples/simple.c
@@ -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);
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) {
diff --git a/examples/tablet.c b/examples/tablet.c
index 85970685..ee6712b1 100644
--- a/examples/tablet.c
+++ b/examples/tablet.c
@@ -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);
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) {
diff --git a/examples/touch.c b/examples/touch.c
index 4eea2bd5..ab2e80ce 100644
--- a/examples/touch.c
+++ b/examples/touch.c
@@ -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);
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) {