aboutsummaryrefslogtreecommitdiffstats
path: root/include/sway/desktop
diff options
context:
space:
mode:
Diffstat (limited to 'include/sway/desktop')
-rw-r--r--include/sway/desktop/idle_inhibit_v1.h28
-rw-r--r--include/sway/desktop/transaction.h33
2 files changed, 40 insertions, 21 deletions
diff --git a/include/sway/desktop/idle_inhibit_v1.h b/include/sway/desktop/idle_inhibit_v1.h
new file mode 100644
index 00000000..e5ed8a3d
--- /dev/null
+++ b/include/sway/desktop/idle_inhibit_v1.h
@@ -0,0 +1,28 @@
1#ifndef _SWAY_DESKTOP_IDLE_INHIBIT_V1_H
2#define _SWAY_DESKTOP_IDLE_INHIBIT_V1_H
3#include <wlr/types/wlr_idle_inhibit_v1.h>
4#include <wlr/types/wlr_idle.h>
5#include "sway/server.h"
6
7struct sway_idle_inhibit_manager_v1 {
8 struct wlr_idle_inhibit_manager_v1 *wlr_manager;
9 struct wl_listener new_idle_inhibitor_v1;
10 struct wl_list inhibitors;
11
12 struct wlr_idle *idle;
13};
14
15struct sway_idle_inhibitor_v1 {
16 struct sway_idle_inhibit_manager_v1 *manager;
17 struct sway_view *view;
18
19 struct wl_list link;
20 struct wl_listener destroy;
21};
22
23void idle_inhibit_v1_check_active(
24 struct sway_idle_inhibit_manager_v1 *manager);
25
26struct sway_idle_inhibit_manager_v1 *sway_idle_inhibit_manager_v1_create(
27 struct wl_display *wl_display, struct wlr_idle *idle);
28#endif
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.