mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-07 05:55:58 +01:00
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.
This commit is contained in:
parent
2d2c79e37c
commit
3c9f791d0e
1 changed files with 7 additions and 0 deletions
|
@ -159,6 +159,9 @@ bool wlr_output_set_mode(struct wlr_output *output,
|
||||||
if (!output->impl || !output->impl->set_mode) {
|
if (!output->impl || !output->impl->set_mode) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
if (output->current_mode == mode) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
return output->impl->set_mode(output, mode);
|
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) {
|
if (!output->impl || !output->impl->set_custom_mode) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
if (output->width == width && output->height == height &&
|
||||||
|
output->refresh == refresh) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
return output->impl->set_custom_mode(output, width, height, refresh);
|
return output->impl->set_custom_mode(output, width, height, refresh);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue