Merge fixes.

This commit is contained in:
Nicholas Marriott
2026-05-19 13:19:21 +01:00
parent 2f6da393e2
commit 55fdfef9d1
2 changed files with 0 additions and 78 deletions

3
tmux.h
View File

@@ -1386,9 +1386,6 @@ struct window {
u_int xpixel;
u_int ypixel;
u_int last_new_pane_x;
u_int last_new_pane_y;
u_int new_sx;
u_int new_sy;
u_int new_xpixel;

View File

@@ -2168,81 +2168,6 @@ window_pane_tiled_geometry(struct window *w, struct window_pane *wp,
return (0);
}
int
window_pane_float_geometry(struct window *w, struct window_pane *wp,
u_int *out_x, u_int *out_y, u_int *out_sx, u_int *out_sy,
struct cmdq_item *item, struct args *args, char **cause)
{
u_int x, y, sx, sy;
const u_int cx = 4, cy = 2;
if (wp != NULL && (wp->flags & PANE_SAVED_FLOAT) &&
!args_has(args, 'x') && !args_has(args, 'y') &&
!args_has(args, 'X') && !args_has(args, 'Y')) {
x = wp->saved_float_xoff;
y = wp->saved_float_yoff;
sx = wp->saved_float_sx;
sy = wp->saved_float_sy;
goto out;
}
/* Default size. */
sx = w->sx / 2;
sy = w->sy / 2;
if (args_has(args, 'x')) {
sx = args_percentage_and_expand(args, 'x', 0, USHRT_MAX, w->sx,
item, cause);
if (*cause != NULL)
return (-1);
}
if (args_has(args, 'y')) {
sy = args_percentage_and_expand(args, 'y', 0, USHRT_MAX, w->sy,
item, cause);
if (*cause != NULL)
return (-1);
}
/* Position defaults to cascading when not defined. */
if (args_has(args, 'X')) {
x = args_percentage_and_expand(args, 'X', 0, USHRT_MAX, w->sx,
item, cause);
if (*cause != NULL)
return (-1);
} else {
if (w->last_new_pane_x == 0)
x = cx;
else {
x = w->last_new_pane_x + cx;
if (w->last_new_pane_x > w->sx)
x = cx;
}
w->last_new_pane_x = x;
}
if (args_has(args, 'Y')) {
y = args_percentage_and_expand(args, 'Y', 0, USHRT_MAX, w->sy,
item, cause);
if (*cause != NULL)
return (-1);
} else {
if (w->last_new_pane_y == 0)
y = cy;
else {
y = w->last_new_pane_y + cy;
if (w->last_new_pane_y > w->sy)
y = cy;
}
w->last_new_pane_y = y;
}
out:
*out_x = x;
*out_y = y;
*out_sx = sx;
*out_sy = sy;
return (0);
}
/* Work out geometry for floating panes. */
int
window_pane_floating_geometry(struct window *w, __unused struct window_pane *wp,