aboutsummaryrefslogtreecommitdiffstats
path: root/sway/resize.c
diff options
context:
space:
mode:
authorLibravatar Drew DeVault <sir@cmpwn.com>2016-06-11 19:39:39 -0400
committerLibravatar GitHub <noreply@github.com>2016-06-11 19:39:39 -0400
commit3ce8cc807753119104d8836b6c77e19fd644a878 (patch)
tree978577aae4b59ae33012fb8c181ab61b82279a97 /sway/resize.c
parentMerge pull request #708 from zandrmartin/assign-command (diff)
parentMerge branch 'master' into set-size-command (diff)
downloadsway-3ce8cc807753119104d8836b6c77e19fd644a878.tar.gz
sway-3ce8cc807753119104d8836b6c77e19fd644a878.tar.zst
sway-3ce8cc807753119104d8836b6c77e19fd644a878.zip
Merge pull request #709 from zandrmartin/set-size-command0.8
implement resize command for absolute dimensions
Diffstat (limited to 'sway/resize.c')
-rw-r--r--sway/resize.c14
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
10bool 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
9bool resize_tiled(int amount, bool use_width) { 23bool 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());