summaryrefslogtreecommitdiffstats
path: root/sway/commands/scratchpad.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/commands/scratchpad.c')
-rw-r--r--sway/commands/scratchpad.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/sway/commands/scratchpad.c b/sway/commands/scratchpad.c
index a1285df5..c995f2f0 100644
--- a/sway/commands/scratchpad.c
+++ b/sway/commands/scratchpad.c
@@ -105,12 +105,12 @@ struct cmd_results *cmd_scratchpad(int argc, char **argv) {
105 return cmd_results_new(CMD_INVALID, "Scratchpad is empty"); 105 return cmd_results_new(CMD_INVALID, "Scratchpad is empty");
106 } 106 }
107 107
108 if (config->handler_context.using_criteria) { 108 if (config->handler_context.node_overridden) {
109 struct sway_container *con = config->handler_context.container; 109 struct sway_container *con = config->handler_context.container;
110 110
111 // If the container is in a floating split container, 111 // If the container is in a floating split container,
112 // operate on the split container instead of the child. 112 // operate on the split container instead of the child.
113 if (container_is_floating_or_child(con)) { 113 if (con && container_is_floating_or_child(con)) {
114 while (con->pending.parent) { 114 while (con->pending.parent) {
115 con = con->pending.parent; 115 con = con->pending.parent;
116 } 116 }
@@ -118,8 +118,9 @@ struct cmd_results *cmd_scratchpad(int argc, char **argv) {
118 118
119 // If using criteria, this command is executed for every container which 119 // If using criteria, this command is executed for every container which
120 // matches the criteria. If this container isn't in the scratchpad, 120 // matches the criteria. If this container isn't in the scratchpad,
121 // we'll just silently return a success. 121 // we'll just silently return a success. The same is true if the
122 if (!con->scratchpad) { 122 // overridden node is not a container.
123 if (!con || !con->scratchpad) {
123 return cmd_results_new(CMD_SUCCESS, NULL); 124 return cmd_results_new(CMD_SUCCESS, NULL);
124 } 125 }
125 scratchpad_toggle_container(con); 126 scratchpad_toggle_container(con);