diff options
author | Tudor Brindus <me@tbrindus.ca> | 2020-10-18 15:55:52 -0400 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2020-10-18 22:12:16 +0200 |
commit | 5bd6a5ce3ff3cb879463646d4f88745420335b23 (patch) | |
tree | e5d4e086b744051d6ba1b2f8d5e1652449c01b43 | |
parent | tiling_drag: emit window move ipc events (diff) | |
download | sway-5bd6a5ce3ff3cb879463646d4f88745420335b23.tar.gz sway-5bd6a5ce3ff3cb879463646d4f88745420335b23.tar.zst sway-5bd6a5ce3ff3cb879463646d4f88745420335b23.zip |
transaction: don't reconfigure X views unless integral coords changed
Sway logical coordinates are doubles, but they get truncated to integers
when sent to Xwayland through `xcb_configure_window`. X11 apps will not
respond to duplicate configure requests (from their truncated point of
view) and cause transactions to time out.
Fixes #5035.
-rw-r--r-- | sway/desktop/transaction.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sway/desktop/transaction.c b/sway/desktop/transaction.c index 2b268e2c..0d0e0635 100644 --- a/sway/desktop/transaction.c +++ b/sway/desktop/transaction.c | |||
@@ -397,8 +397,12 @@ static bool should_configure(struct sway_node *node, | |||
397 | // Xwayland views are position-aware and need to be reconfigured | 397 | // Xwayland views are position-aware and need to be reconfigured |
398 | // when their position changes. | 398 | // when their position changes. |
399 | if (node->sway_container->view->type == SWAY_VIEW_XWAYLAND) { | 399 | if (node->sway_container->view->type == SWAY_VIEW_XWAYLAND) { |
400 | if (cstate->content_x != istate->content_x || | 400 | // Sway logical coordinates are doubles, but they get truncated to |
401 | cstate->content_y != istate->content_y) { | 401 | // integers when sent to Xwayland through `xcb_configure_window`. |
402 | // X11 apps will not respond to duplicate configure requests (from their | ||
403 | // truncated point of view) and cause transactions to time out. | ||
404 | if ((int)cstate->content_x != (int)istate->content_x || | ||
405 | (int)cstate->content_y != (int)istate->content_y) { | ||
402 | return true; | 406 | return true; |
403 | } | 407 | } |
404 | } | 408 | } |