aboutsummaryrefslogtreecommitdiff
path: root/include/sway
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2018-07-23 07:57:48 -0400
committerGitHub <noreply@github.com>2018-07-23 07:57:48 -0400
commit0515b37dfde41cfa85529ac0f8b991a1bec749d2 (patch)
tree5f855ab05c0ec079f4487e9527f87f37c1929bf1 /include/sway
parent89dc047ca9558efe4efe8a81a15903cd0f0bdcba (diff)
parent12e90fa6006b2cf17a5b5983b5a6e2e70cda58d3 (diff)
Merge pull request #2323 from RyanDwyer/scratchpad
Implement scratchpad
Diffstat (limited to 'include/sway')
-rw-r--r--include/sway/scratchpad.h26
-rw-r--r--include/sway/tree/container.h5
-rw-r--r--include/sway/tree/layout.h2
3 files changed, 33 insertions, 0 deletions
diff --git a/include/sway/scratchpad.h b/include/sway/scratchpad.h
new file mode 100644
index 00000000..5af5256f
--- /dev/null
+++ b/include/sway/scratchpad.h
@@ -0,0 +1,26 @@
+#ifndef _SWAY_SCRATCHPAD_H
+#define _SWAY_SCRATCHPAD_H
+
+#include "tree/container.h"
+
+/**
+ * Move a container to the scratchpad.
+ */
+void scratchpad_add_container(struct sway_container *con);
+
+/**
+ * Remove a container from the scratchpad.
+ */
+void scratchpad_remove_container(struct sway_container *con);
+
+/**
+ * Show or hide the next container on the scratchpad.
+ */
+void scratchpad_toggle_auto(void);
+
+/**
+ * Show or hide a specific container on the scratchpad.
+ */
+void scratchpad_toggle_container(struct sway_container *con);
+
+#endif
diff --git a/include/sway/tree/container.h b/include/sway/tree/container.h
index 59c5b4c7..2a4be18c 100644
--- a/include/sway/tree/container.h
+++ b/include/sway/tree/container.h
@@ -135,6 +135,11 @@ struct sway_container {
struct sway_container *parent;
+ // Indicates that the container is a scratchpad container.
+ // Both hidden and visible scratchpad containers have scratchpad=true.
+ // Hidden scratchpad containers have a NULL parent.
+ bool scratchpad;
+
float alpha;
struct wlr_texture *title_focused;
diff --git a/include/sway/tree/layout.h b/include/sway/tree/layout.h
index 5a78fd58..7d7da2d7 100644
--- a/include/sway/tree/layout.h
+++ b/include/sway/tree/layout.h
@@ -35,6 +35,8 @@ struct sway_root {
struct wl_list outputs; // sway_output::link
+ list_t *scratchpad; // struct sway_container
+
struct {
struct wl_signal new_container;
} events;