aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorFurkan Sahin <furkan-dev@proton.me>2020-07-10 18:04:45 +0200
committerFurkan Sahin <furkan-dev@proton.me>2020-07-10 18:04:45 +0200
commitab9342cb296fc0c37b735c59ac15cedb72c97807 (patch)
tree59b5e3e01b63e7a8a8d5c794f776dc24913565b5 /include
parenta45be30cac44730b512325a457f0d64aac8e2e30 (diff)
config/output: don't change output state before commit
Previously, we called output_disable prior to wlr_output_commit. This mutates Sway's output state before the output commit actually succeeds. This results in Sway's state getting out-of-sync with wlroots'. An alternative fix [1] was to revert the changes made by output_disable in case of failure. This is a little complicated. Instead, this patch makes it so Sway's internal state is never changed before a successful wlr_output commit. We had two output flags: enabled and configured. However enabled was set prior to the output becoming enabled, and was used to prevent the output event handlers (specifically, the mode handler) from calling apply_output_config again (infinite loop). Rename enabled to enabling and use it exclusively for this purpose. Rename configure to enabled, because that's what it really means. [1]: https://github.com/swaywm/sway/pull/5521 Closes: https://github.com/swaywm/sway/issues/5483 (cherry picked from commit 5432f00adfdd8375fb422ad9033253d17f04efc7)
Diffstat (limited to 'include')
-rw-r--r--include/sway/output.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/sway/output.h b/include/sway/output.h
index cabb4b55..f27f6344 100644
--- a/include/sway/output.h
+++ b/include/sway/output.h
@@ -36,7 +36,7 @@ struct sway_output {
// last applied mode when the output is DPMS'ed
struct wlr_output_mode *current_mode;
- bool enabled, configured;
+ bool enabling, enabled;
list_t *workspaces;
struct sway_output_state current;
@@ -98,7 +98,7 @@ struct sway_output *all_output_by_name_or_id(const char *name_or_id);
void output_sort_workspaces(struct sway_output *output);
-void output_configure(struct sway_output *output);
+void output_enable(struct sway_output *output);
void output_disable(struct sway_output *output);