diff options
author | Brian Ashworth <bosrsf04@gmail.com> | 2019-02-16 16:14:27 -0500 |
---|---|---|
committer | emersion <contact@emersion.fr> | 2019-02-16 23:37:36 +0100 |
commit | 272ca061714a77597feae1075cdd2d44ebdf5ce3 (patch) | |
tree | 27ea1aefcf2b88364831bf2793288c47c3a033c6 /sway/config.c | |
parent | Merge pull request #3701 from emersion/meson-subproject-disable-unneeded (diff) | |
download | sway-272ca061714a77597feae1075cdd2d44ebdf5ce3.tar.gz sway-272ca061714a77597feae1075cdd2d44ebdf5ce3.tar.zst sway-272ca061714a77597feae1075cdd2d44ebdf5ce3.zip |
Fix reload freeze when not modsetting current mode
This fixes the issue of the display freezing on reload with
wlroots#1545.
On master, all output configs are applied on reload. This may cause an
output to have its config applied up to three times, instead of just
once. The three cases are: output name, output identifier, and wildcard.
Not only is this inefficient, but it can cause swaybg to be spawned and
immediately killed.
However, swaybg requires two roundtrips of wl_display (to obtain needed
globals) before it enters its normal event loop. Modesetting will
roundtrip the wl_display. Without modesetting, waitpid for killing
swaybg could block infinitely due to swaybg being blocked by
wl_display_roundtrip.
This only configured an output once. It either uses the wildcard config
or creates an empty wildcard config and applies that. This also fixes a
bug where an output would not be reset when there is no output config to
apply to it.
Diffstat (limited to 'sway/config.c')
-rw-r--r-- | sway/config.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/sway/config.c b/sway/config.c index cd2d18a2..206ca95c 100644 --- a/sway/config.c +++ b/sway/config.c | |||
@@ -471,9 +471,8 @@ bool load_main_config(const char *file, bool is_active, bool validating) { | |||
471 | } | 471 | } |
472 | 472 | ||
473 | if (is_active) { | 473 | if (is_active) { |
474 | for (int i = 0; i < config->output_configs->length; i++) { | 474 | reset_outputs(); |
475 | apply_output_config_to_outputs(config->output_configs->items[i]); | 475 | |
476 | } | ||
477 | config->reloading = false; | 476 | config->reloading = false; |
478 | if (config->swaynag_config_errors.pid > 0) { | 477 | if (config->swaynag_config_errors.pid > 0) { |
479 | swaynag_show(&config->swaynag_config_errors); | 478 | swaynag_show(&config->swaynag_config_errors); |