aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Ashworth <bosrsf04@gmail.com>2019-02-16 18:09:41 -0500
committeremersion <contact@emersion.fr>2019-02-17 00:12:59 +0100
commit3c9f791d0e0a0f0b3437b0b26ea606ce3344cfe2 (patch)
treef7eb8e4af302f33d61f6f7c4c2dc5493f0733ed4
parent2d2c79e37c6a319d307af316119a9e9247612a2c (diff)
wlr_output: do not modeset to current mode
There is no point in modesetting an output to a mode that it is already set to. Modesetting will cause the output to briefly flicker which is undesirable for a noop. This prevents modesetting any wlr_output, regardless of the backend, to it's currently set mode.
-rw-r--r--types/wlr_output.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/types/wlr_output.c b/types/wlr_output.c
index f49d48e3..a8c86771 100644
--- a/types/wlr_output.c
+++ b/types/wlr_output.c
@@ -159,6 +159,9 @@ bool wlr_output_set_mode(struct wlr_output *output,
if (!output->impl || !output->impl->set_mode) {
return false;
}
+ if (output->current_mode == mode) {
+ return true;
+ }
return output->impl->set_mode(output, mode);
}
@@ -167,6 +170,10 @@ bool wlr_output_set_custom_mode(struct wlr_output *output, int32_t width,
if (!output->impl || !output->impl->set_custom_mode) {
return false;
}
+ if (output->width == width && output->height == height &&
+ output->refresh == refresh) {
+ return true;
+ }
return output->impl->set_custom_mode(output, width, height, refresh);
}