diff options
author | Drew DeVault <sir@cmpwn.com> | 2018-07-28 09:30:12 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-28 09:30:12 -0400 |
commit | 53069f1403587d230e8f2c6adb61daa7c5e022b7 (patch) | |
tree | 67b966d2736ba19540b0102381710f9fb5316e61 /sway/commands/scratchpad.c | |
parent | e4b54ac16e52cea9fe7f8385e87033764d36522f (diff) | |
parent | 0337609667ad1d01e0e0dc19231373df3fbf7c87 (diff) |
Merge pull request #2360 from RyanDwyer/floating-containers
Allow containers to float
Diffstat (limited to 'sway/commands/scratchpad.c')
-rw-r--r-- | sway/commands/scratchpad.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/sway/commands/scratchpad.c b/sway/commands/scratchpad.c index ccc07c87..01a91d65 100644 --- a/sway/commands/scratchpad.c +++ b/sway/commands/scratchpad.c @@ -19,11 +19,19 @@ struct cmd_results *cmd_scratchpad(int argc, char **argv) { } if (config->handler_context.using_criteria) { + struct sway_container *con = config->handler_context.current_container; + + // 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->layout != L_FLOATING) { + con = con->parent; + } + } + // If using criteria, this command is executed for every container which // matches the criteria. If this container isn't in the scratchpad, // we'll just silently return a success. - struct sway_container *con = config->handler_context.current_container; - wlr_log(WLR_INFO, "cmd_scratchpad(%s)", con->name); if (!con->scratchpad) { return cmd_results_new(CMD_SUCCESS, NULL, NULL); } |