diff options
author | Drew DeVault <sir@cmpwn.com> | 2016-06-11 19:39:39 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-06-11 19:39:39 -0400 |
commit | 3ce8cc807753119104d8836b6c77e19fd644a878 (patch) | |
tree | 978577aae4b59ae33012fb8c181ab61b82279a97 /sway/resize.c | |
parent | f1268053a62a83c0169b61451d01649a3f3185e3 (diff) | |
parent | a6f4bf60f2a6b9aa2ae5cadee5c1aada2ff1f6b3 (diff) | |
download | sway-3ce8cc807753119104d8836b6c77e19fd644a878.tar.xz |
Merge pull request #709 from zandrmartin/set-size-command
implement resize command for absolute dimensions
Diffstat (limited to 'sway/resize.c')
-rw-r--r-- | sway/resize.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/sway/resize.c b/sway/resize.c index f1b1f4ae..9411cfd8 100644 --- a/sway/resize.c +++ b/sway/resize.c @@ -5,6 +5,20 @@ #include "log.h" #include "input_state.h" #include "handlers.h" +#include "resize.h" + +bool set_size_tiled(int amount, bool use_width) { + int desired; + swayc_t *focused = get_focused_view(swayc_active_workspace()); + + if (use_width) { + desired = amount - focused->width; + } else { + desired = amount - focused->height; + } + + return resize_tiled(desired, use_width); +} bool resize_tiled(int amount, bool use_width) { swayc_t *parent = get_focused_view(swayc_active_workspace()); |