diff options
author | 2019-11-28 09:45:15 +0000 | |
---|---|---|
committer | 2019-11-28 09:45:15 +0000 | |
commit | 4a8b0ea508ec8e7097113da4d3016e95759381f3 (patch) | |
tree | ee0ca6188d35c152446efbf4943c93b16eb957e8 /usr.bin/tmux/cmd-resize-window.c | |
parent | Store xpixel/ypixel from TIOCGWINSZ and add formats. (diff) | |
download | wireguard-openbsd-4a8b0ea508ec8e7097113da4d3016e95759381f3.tar.xz wireguard-openbsd-4a8b0ea508ec8e7097113da4d3016e95759381f3.zip |
Make a best effort to set xpixel and ypixel for each pane and add
formats for them.
Diffstat (limited to 'usr.bin/tmux/cmd-resize-window.c')
-rw-r--r-- | usr.bin/tmux/cmd-resize-window.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/usr.bin/tmux/cmd-resize-window.c b/usr.bin/tmux/cmd-resize-window.c index f3e37269017..b17b3cd66d6 100644 --- a/usr.bin/tmux/cmd-resize-window.c +++ b/usr.bin/tmux/cmd-resize-window.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-resize-window.c,v 1.2 2019/09/23 15:41:11 nicm Exp $ */ +/* $OpenBSD: cmd-resize-window.c,v 1.3 2019/11/28 09:45:15 nicm Exp $ */ /* * Copyright (c) 2018 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -53,6 +53,7 @@ cmd_resize_window_exec(struct cmd *self, struct cmdq_item *item) const char *errstr; char *cause; u_int adjust, sx, sy; + int xpixel = -1, ypixel = -1; if (args->argc == 0) adjust = 1; @@ -97,13 +98,16 @@ cmd_resize_window_exec(struct cmd *self, struct cmdq_item *item) } else if (args_has(args, 'D')) sy += adjust; - if (args_has(args, 'A')) - default_window_size(NULL, s, w, &sx, &sy, WINDOW_SIZE_LARGEST); - else if (args_has(args, 'a')) - default_window_size(NULL, s, w, &sx, &sy, WINDOW_SIZE_SMALLEST); + if (args_has(args, 'A')) { + default_window_size(NULL, s, w, &sx, &sy, &xpixel, &ypixel, + WINDOW_SIZE_LARGEST); + } else if (args_has(args, 'a')) { + default_window_size(NULL, s, w, &sx, &sy, &xpixel, &ypixel, + WINDOW_SIZE_SMALLEST); + } options_set_number(w->options, "window-size", WINDOW_SIZE_MANUAL); - resize_window(w, sx, sy); + resize_window(w, sx, sy, xpixel, ypixel); return (CMD_RETURN_NORMAL); } |