diff options
author | Simon Ser <contact@emersion.fr> | 2019-04-22 14:03:59 +0300 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2019-04-22 11:15:38 -0600 |
commit | 56ceed38bffcc741b5a80741d0207101905370ae (patch) | |
tree | 1bf38e779c777f78cd1ceeacfb37d4ef2f178b09 /rootston | |
parent | 8acbf449cceb55120bc3fdd20c953afc6ca76f09 (diff) |
rootston: use wlr_output_preferred_mode
Also fix rootston setting the preferred mode when another mode is specified in
the config file.
Diffstat (limited to 'rootston')
-rw-r--r-- | rootston/output.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/rootston/output.c b/rootston/output.c index e83cdc1f..32300c9e 100644 --- a/rootston/output.c +++ b/rootston/output.c @@ -643,12 +643,8 @@ void handle_new_output(struct wl_listener *listener, void *data) { struct roots_output_config *output_config = roots_config_get_output(config, wlr_output); - if ((!output_config || output_config->enable) && !wl_list_empty(&wlr_output->modes)) { - struct wlr_output_mode *mode = - wl_container_of(wlr_output->modes.prev, mode, link); - wlr_output_set_mode(wlr_output, mode); - } - + struct wlr_output_mode *preferred_mode = + wlr_output_preferred_mode(wlr_output); if (output_config) { if (output_config->enable) { if (wlr_output_is_drm(wlr_output)) { @@ -662,6 +658,8 @@ void handle_new_output(struct wl_listener *listener, void *data) { if (output_config->mode.width) { set_mode(wlr_output, output_config); + } else if (preferred_mode != NULL) { + wlr_output_set_mode(wlr_output, preferred_mode); } wlr_output_set_scale(wlr_output, output_config->scale); @@ -672,6 +670,9 @@ void handle_new_output(struct wl_listener *listener, void *data) { wlr_output_enable(wlr_output, false); } } else { + if (preferred_mode != NULL) { + wlr_output_set_mode(wlr_output, preferred_mode); + } wlr_output_layout_add_auto(desktop->layout, wlr_output); } |