aboutsummaryrefslogtreecommitdiff
path: root/sway/commands/scratchpad.c
diff options
context:
space:
mode:
authorKenny Levinsen <kl@kl.wtf>2021-02-12 23:22:51 +0100
committerTudor Brindus <me@tbrindus.ca>2021-02-16 22:05:00 -0500
commita047b5ee4a2a67d30d93641ff86531d54b8e0879 (patch)
tree271666c6254e4fabf943c1153224059411a5ce56 /sway/commands/scratchpad.c
parent28cadf558090854ace1df1a0a64f5fbc059541c0 (diff)
container: Move pending state to state struct
Pending state is currently inlined directly in the container struct, while the current state is in a state struct. A side-effect of this is that it is not immediately obvious that pending double-buffered state is accessed, nor is it obvious what state is double-buffered. Instead, use the state struct for both current and pending.
Diffstat (limited to 'sway/commands/scratchpad.c')
-rw-r--r--sway/commands/scratchpad.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/sway/commands/scratchpad.c b/sway/commands/scratchpad.c
index 34871bc6..a1285df5 100644
--- a/sway/commands/scratchpad.c
+++ b/sway/commands/scratchpad.c
@@ -21,8 +21,8 @@ static void scratchpad_toggle_auto(void) {
// If the focus is in a floating split container,
// operate on the split container instead of the child.
if (focus && container_is_floating_or_child(focus)) {
- while (focus->parent) {
- focus = focus->parent;
+ while (focus->pending.parent) {
+ focus = focus->pending.parent;
}
}
@@ -52,7 +52,7 @@ static void scratchpad_toggle_auto(void) {
// In this case we move it to the current workspace.
for (int i = 0; i < root->scratchpad->length; ++i) {
struct sway_container *con = root->scratchpad->items[i];
- if (con->parent) {
+ if (con->pending.parent) {
sway_log(SWAY_DEBUG,
"Moving a visible scratchpad window (%s) to this workspace",
con->title);
@@ -80,7 +80,7 @@ static void scratchpad_toggle_container(struct sway_container *con) {
struct sway_seat *seat = input_manager_current_seat();
struct sway_workspace *ws = seat_get_focused_workspace(seat);
// Check if it matches a currently visible scratchpad window and hide it.
- if (con->workspace && ws == con->workspace) {
+ if (con->pending.workspace && ws == con->pending.workspace) {
root_scratchpad_hide(con);
return;
}
@@ -111,8 +111,8 @@ struct cmd_results *cmd_scratchpad(int argc, char **argv) {
// If the container is in a floating split container,
// operate on the split container instead of the child.
if (container_is_floating_or_child(con)) {
- while (con->parent) {
- con = con->parent;
+ while (con->pending.parent) {
+ con = con->pending.parent;
}
}