aboutsummaryrefslogtreecommitdiff
path: root/sway/resize.c
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2016-06-11 19:39:39 -0400
committerGitHub <noreply@github.com>2016-06-11 19:39:39 -0400
commit3ce8cc807753119104d8836b6c77e19fd644a878 (patch)
tree978577aae4b59ae33012fb8c181ab61b82279a97 /sway/resize.c
parentf1268053a62a83c0169b61451d01649a3f3185e3 (diff)
parenta6f4bf60f2a6b9aa2ae5cadee5c1aada2ff1f6b3 (diff)
downloadsway-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.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 @@
#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());