aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Orzechowski <alex@ozal.ski>2023-06-26 18:34:19 -0400
committerSimon Ser <contact@emersion.fr>2023-08-16 18:37:55 +0200
commit63351cf81f8eee563971a87719b1294e45d1a4bd (patch)
tree6bfa5e2ad1f6e0ec5e6c683a63158b1834639d45
parentf042de3f516ec13fe9500b27a024330843941060 (diff)
output: Schedule mode updates to happen with rest of output events
-rw-r--r--types/output/output.c31
1 files changed, 16 insertions, 15 deletions
diff --git a/types/output/output.c b/types/output/output.c
index 2845fa20..e2ac5dc8 100644
--- a/types/output/output.c
+++ b/types/output/output.c
@@ -314,18 +314,6 @@ static void output_apply_state(struct wlr_output *output,
bool geometry_updated = state->committed &
(WLR_OUTPUT_STATE_MODE | WLR_OUTPUT_STATE_TRANSFORM |
WLR_OUTPUT_STATE_SUBPIXEL);
- if (geometry_updated || scale_updated) {
- struct wl_resource *resource;
- wl_resource_for_each(resource, &output->resources) {
- if (geometry_updated) {
- send_geometry(resource);
- }
- if (scale_updated) {
- send_scale(resource);
- }
- }
- wlr_output_schedule_done(output);
- }
// Destroy the swapchains when an output is disabled
if ((state->committed & WLR_OUTPUT_STATE_ENABLED) && !state->enabled) {
@@ -360,6 +348,7 @@ static void output_apply_state(struct wlr_output *output,
wlr_swapchain_set_buffer_submitted(output->swapchain, state->buffer);
}
+ bool mode_updated = false;
if (state->committed & WLR_OUTPUT_STATE_MODE) {
int width = 0, height = 0, refresh = 0;
switch (state->mode_type) {
@@ -394,12 +383,24 @@ static void output_apply_state(struct wlr_output *output,
output->swapchain = NULL;
}
- struct wl_resource *resource;
- wl_resource_for_each(resource, &output->resources) {
+ mode_updated = true;
+ }
+ }
+
+ if (geometry_updated || scale_updated || mode_updated) {
+ struct wl_resource *resource;
+ wl_resource_for_each(resource, &output->resources) {
+ if (mode_updated) {
send_current_mode(resource);
}
- wlr_output_schedule_done(output);
+ if (geometry_updated) {
+ send_geometry(resource);
+ }
+ if (scale_updated) {
+ send_scale(resource);
+ }
}
+ wlr_output_schedule_done(output);
}
}