swayfx/sway
Ryan Dwyer d10ccc1eb1 Correctly track saved surfaces during multiple transactions
Fixes #2364.

Suppose a view is 600px wide, and we tell it to resize to 601px during a
resize operation. We create a transaction, save the 600px buffer and
send the configure. This buffer is saved into the associated
instruction, and is rendered while we wait for the view to commit a
601px buffer.

Before the view commits the 601px buffer, suppose we tell it to resize
to 602px. The new transaction will also save the buffer, but it's still
the 600px buffer because we haven't received a new one yet.

Then suppose the view commits its original 601px buffer. This completes
the first transaction, so we apply the 601px width to the container.
There's still the second (now only) transaction remaining, so we render
the saved buffer from that. But this is still the 600px buffer, and we
believe it's 601px. Whoops.

The problem here is we can't stack buffers like this. So this commit
removes the saved buffer from the instructions, places it in the view
instead, and re-saves the latest buffer every time the view completes a
transaction and still has further pending transactions.

As saved buffers are now specific to views rather than instructions, the
functions for saving and removing the saved buffer have been moved to
view.c.

The calls to save and restore the buffer have been relocated to more
appropriate functions too, favouring transaction_commit and
transaction_apply rather than transaction_add_container and
transaction_destroy.
2018-08-01 16:24:15 +10:00
..
commands Create list for mouse binds when creating new mode 2018-07-31 23:49:42 -04:00
config Implement setting NumLock and CapsLock status 2018-07-25 17:24:45 +02:00
desktop Correctly track saved surfaces during multiple transactions 2018-08-01 16:24:15 +10:00
input Bindings use advised keyboard repeat parameters 2018-07-29 19:15:10 -04:00
tree Correctly track saved surfaces during multiple transactions 2018-08-01 16:24:15 +10:00
base64.c Rework get_clipboard implementation 2017-07-07 21:51:34 +02:00
commands.c Implement scratchpad 2018-07-23 08:24:32 +10:00
config.c Implement floating_modifier <mod> [inverse|normal] 2018-07-24 18:41:08 -04:00
criteria.c more style fixes, reorder config.h include 2018-07-25 13:43:21 +02:00
debug-tree.c Add L_FLOATING back to debug tree 2018-06-01 23:14:58 +10:00
ipc-json.c Mark containers as urgent in IPC if they have urgent views 2018-07-16 14:30:31 +10:00
ipc-server.c Make focus part of transactions 2018-07-15 22:08:26 +10:00
main.c Fix deferred command handling 2018-07-19 01:39:58 -04:00
meson.build Add xkb_numlock/xkb_capslock commands (#2311) 2018-07-25 17:24:45 +02:00
scratchpad.c Focus child when showing a scratchpad container 2018-07-28 22:41:04 +10:00
security.c Add minimal config subsystem 2017-12-05 10:40:55 +01:00
server.c reverted includes of "sway/config.h" and replaced with "config.h" from meson build 2018-07-25 13:32:20 +02:00
sway-bar.5.scd Add sway-bar(5) 2018-05-11 21:13:43 -04:00
sway-input.5.scd Escaping underscores in tap_button_map 2018-07-29 14:47:53 +02:00
sway.1.scd delete references to swaygrab 2018-07-30 16:24:46 +01:00
sway.5.scd Add documentation for urgent command 2018-07-16 10:15:18 +10:00