diff options
author | Drew DeVault <sir@cmpwn.com> | 2018-07-23 20:27:56 -0400 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2018-07-23 20:31:11 -0400 |
commit | f4b882475eee7a81c206c7825616cc4656b2f60b (patch) | |
tree | 38e6ebf81b235424f105dcbcbb194e5e9eac70c0 /include/sway/desktop | |
parent | acd79e1505c06089e4fb9fb6c0c6e1d351ba9176 (diff) | |
parent | 224ade138208e9aa525423cbfbd643aa9d9b63c3 (diff) |
Merge branch 'master' into pid-workspaces
Diffstat (limited to 'include/sway/desktop')
-rw-r--r-- | include/sway/desktop/idle_inhibit_v1.h | 28 | ||||
-rw-r--r-- | include/sway/desktop/transaction.h | 33 |
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 @@ +#ifndef _SWAY_DESKTOP_IDLE_INHIBIT_V1_H +#define _SWAY_DESKTOP_IDLE_INHIBIT_V1_H +#include <wlr/types/wlr_idle_inhibit_v1.h> +#include <wlr/types/wlr_idle.h> +#include "sway/server.h" + +struct sway_idle_inhibit_manager_v1 { + struct wlr_idle_inhibit_manager_v1 *wlr_manager; + struct wl_listener new_idle_inhibitor_v1; + struct wl_list inhibitors; + + struct wlr_idle *idle; +}; + +struct sway_idle_inhibitor_v1 { + struct sway_idle_inhibit_manager_v1 *manager; + struct sway_view *view; + + struct wl_list link; + struct wl_listener destroy; +}; + +void idle_inhibit_v1_check_active( + struct sway_idle_inhibit_manager_v1 *manager); + +struct sway_idle_inhibit_manager_v1 *sway_idle_inhibit_manager_v1_create( + struct wl_display *wl_display, struct wlr_idle *idle); +#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 @@ /** * Transactions enable us to perform atomic layout updates. * - * When we want to make adjustments to the layout, we create a transaction. - * A transaction contains a list of affected containers and their new state. + * A transaction contains a list of containers and their new state. * A state might contain a new size, or new border settings, or new parent/child * relationships. * - * Calling transaction_commit() makes sway notify of all the affected clients - * with their new sizes. We then wait for all the views to respond with their - * new surface sizes. When all are ready, or when a timeout has passed, we apply - * the updates all at the same time. - */ - -struct sway_transaction; - -/** - * Create a new transaction. - */ -struct sway_transaction *transaction_create(void); - -/** - * Add a container's pending state to the transaction. + * Committing a transaction makes sway notify of all the affected clients with + * their new sizes. We then wait for all the views to respond with their new + * surface sizes. When all are ready, or when a timeout has passed, we apply the + * updates all at the same time. + * + * When we want to make adjustments to the layout, we change the pending state + * in containers, mark them as dirty and call transaction_commit_dirty(). This + * create and commits a transaction from the dirty containers. */ -void transaction_add_container(struct sway_transaction *transaction, - struct sway_container *container); /** - * Submit a transaction to the client views for configuration. + * Find all dirty containers, create and commit a transaction containing them, + * and unmark them as dirty. */ -void transaction_commit(struct sway_transaction *transaction); +void transaction_commit_dirty(void); /** * Notify the transaction system that a view is ready for the new layout. |