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 | Merge pull request #708 from zandrmartin/assign-command (diff) | |
parent | Merge branch 'master' into set-size-command (diff) | |
download | sway-3ce8cc807753119104d8836b6c77e19fd644a878.tar.gz sway-3ce8cc807753119104d8836b6c77e19fd644a878.tar.zst sway-3ce8cc807753119104d8836b6c77e19fd644a878.zip |
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 @@ | |||
5 | #include "log.h" | 5 | #include "log.h" |
6 | #include "input_state.h" | 6 | #include "input_state.h" |
7 | #include "handlers.h" | 7 | #include "handlers.h" |
8 | #include "resize.h" | ||
9 | |||
10 | bool set_size_tiled(int amount, bool use_width) { | ||
11 | int desired; | ||
12 | swayc_t *focused = get_focused_view(swayc_active_workspace()); | ||
13 | |||
14 | if (use_width) { | ||
15 | desired = amount - focused->width; | ||
16 | } else { | ||
17 | desired = amount - focused->height; | ||
18 | } | ||
19 | |||
20 | return resize_tiled(desired, use_width); | ||
21 | } | ||
8 | 22 | ||
9 | bool resize_tiled(int amount, bool use_width) { | 23 | bool resize_tiled(int amount, bool use_width) { |
10 | swayc_t *parent = get_focused_view(swayc_active_workspace()); | 24 | swayc_t *parent = get_focused_view(swayc_active_workspace()); |