aboutsummaryrefslogtreecommitdiff
path: root/sway/input
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2020-07-10 18:04:45 +0200
committerBrian Ashworth <bosrsf04@gmail.com>2020-07-10 18:18:27 -0400
commit5432f00adfdd8375fb422ad9033253d17f04efc7 (patch)
tree857b6fbff00a7dd11a1b96904acd81bd05ef0ee0 /sway/input
parentea3ba203cc65671d9bf9da5ddbc698b18ed7685c (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
Diffstat (limited to 'sway/input')
-rw-r--r--sway/input/cursor.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sway/input/cursor.c b/sway/input/cursor.c
index d10ba444..0d5b076b 100644
--- a/sway/input/cursor.c
+++ b/sway/input/cursor.c
@@ -99,8 +99,8 @@ struct sway_node *node_at_coords(
return NULL;
}
struct sway_output *output = wlr_output->data;
- if (!output || !output->configured) {
- // output is being destroyed or is being configured
+ if (!output || !output->enabled) {
+ // output is being destroyed or is being enabled
return NULL;
}
double ox = lx, oy = ly;