aboutsummaryrefslogtreecommitdiffstats
path: root/include/sway/desktop/transaction.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/sway/desktop/transaction.h')
-rw-r--r--include/sway/desktop/transaction.h33
1 files changed, 12 insertions, 21 deletions
diff --git a/include/sway/desktop/transaction.h b/include/sway/desktop/transaction.h
index 7ab80eb8..cee4afed 100644
--- a/include/sway/desktop/transaction.h
+++ b/include/sway/desktop/transaction.h
@@ -6,34 +6,25 @@
6/** 6/**
7 * Transactions enable us to perform atomic layout updates. 7 * Transactions enable us to perform atomic layout updates.
8 * 8 *
9 * When we want to make adjustments to the layout, we create a transaction. 9 * A transaction contains a list of containers and their new state.
10 * A transaction contains a list of affected containers and their new state.
11 * A state might contain a new size, or new border settings, or new parent/child 10 * A state might contain a new size, or new border settings, or new parent/child
12 * relationships. 11 * relationships.
13 * 12 *
14 * Calling transaction_commit() makes sway notify of all the affected clients 13 * Committing a transaction makes sway notify of all the affected clients with
15 * with their new sizes. We then wait for all the views to respond with their 14 * their new sizes. We then wait for all the views to respond with their new
16 * new surface sizes. When all are ready, or when a timeout has passed, we apply 15 * surface sizes. When all are ready, or when a timeout has passed, we apply the
17 * the updates all at the same time. 16 * updates all at the same time.
18 */ 17 *
19 18 * When we want to make adjustments to the layout, we change the pending state
20struct sway_transaction; 19 * in containers, mark them as dirty and call transaction_commit_dirty(). This
21 20 * create and commits a transaction from the dirty containers.
22/**
23 * Create a new transaction.
24 */
25struct sway_transaction *transaction_create(void);
26
27/**
28 * Add a container's pending state to the transaction.
29 */ 21 */
30void transaction_add_container(struct sway_transaction *transaction,
31 struct sway_container *container);
32 22
33/** 23/**
34 * Submit a transaction to the client views for configuration. 24 * Find all dirty containers, create and commit a transaction containing them,
25 * and unmark them as dirty.
35 */ 26 */
36void transaction_commit(struct sway_transaction *transaction); 27void transaction_commit_dirty(void);
37 28
38/** 29/**
39 * Notify the transaction system that a view is ready for the new layout. 30 * Notify the transaction system that a view is ready for the new layout.