mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-25 22:25:58 +01:00
tinywl: enable and commit output when modesetting
While at it, choose the preferred mode instead of the last one.
This commit is contained in:
parent
8fc16890c7
commit
31f721286a
1 changed files with 7 additions and 4 deletions
|
@ -648,12 +648,15 @@ static void server_new_output(struct wl_listener *listener, void *data) {
|
||||||
/* Some backends don't have modes. DRM+KMS does, and we need to set a mode
|
/* Some backends don't have modes. DRM+KMS does, and we need to set a mode
|
||||||
* before we can use the output. The mode is a tuple of (width, height,
|
* before we can use the output. The mode is a tuple of (width, height,
|
||||||
* refresh rate), and each monitor supports only a specific set of modes. We
|
* refresh rate), and each monitor supports only a specific set of modes. We
|
||||||
* just pick the first, a more sophisticated compositor would let the user
|
* just pick the monitor's preferred mode, a more sophisticated compositor
|
||||||
* configure it or pick the mode the display advertises as preferred. */
|
* would let the user configure it. */
|
||||||
if (!wl_list_empty(&wlr_output->modes)) {
|
if (!wl_list_empty(&wlr_output->modes)) {
|
||||||
struct wlr_output_mode *mode =
|
struct wlr_output_mode *mode = wlr_output_preferred_mode(wlr_output);
|
||||||
wl_container_of(wlr_output->modes.prev, mode, link);
|
|
||||||
wlr_output_set_mode(wlr_output, mode);
|
wlr_output_set_mode(wlr_output, mode);
|
||||||
|
wlr_output_enable(wlr_output, true);
|
||||||
|
if (!wlr_output_commit(wlr_output)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Allocates and configures our state for this output */
|
/* Allocates and configures our state for this output */
|
||||||
|
|
Loading…
Reference in a new issue