mirror of
https://github.com/tmux/tmux.git
synced 2026-10-10 12:14:43 +00:00
Merge remote-tracking branch 'refs/remotes/tmux-openbsd/master'
* refs/remotes/tmux-openbsd/master: Clip floating panes exactly at window edge, don't let the border creep into the first outside column. Invalidate scene when window is resized. Add a -C flag to new-pane to have a modal pane close when the mouse is clicked outside it, GitHub issue 5400.
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
/* $OpenBSD: cmd-split-window.c,v 1.145 2026/07/15 13:02:33 nicm Exp $ */
|
/* $OpenBSD: cmd-split-window.c,v 1.146 2026/07/21 12:28:43 nicm Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2009 Nicholas Marriott <nicholas.marriott@gmail.com>
|
* Copyright (c) 2009 Nicholas Marriott <nicholas.marriott@gmail.com>
|
||||||
@@ -40,8 +40,8 @@ const struct cmd_entry cmd_new_pane_entry = {
|
|||||||
.name = "new-pane",
|
.name = "new-pane",
|
||||||
.alias = "newp",
|
.alias = "newp",
|
||||||
|
|
||||||
.args = { "bB:c:de:EfF:hIkl:LMm:Op:PR:s:S:t:T:vWx:X:y:Y:Z", 0, -1, NULL },
|
.args = { "bB:Cc:de:EfF:hIkl:LMm:Op:PR:s:S:t:T:vWx:X:y:Y:Z", 0, -1, NULL },
|
||||||
.usage = "[-bdefhIklMOPvWZ] [-B border-lines] "
|
.usage = "[-bCdefhIklMOPvWZ] [-B border-lines] "
|
||||||
"[-c start-directory] [-e environment] "
|
"[-c start-directory] [-e environment] "
|
||||||
"[-F format] [-l size] [-m message] [-p percentage] "
|
"[-F format] [-l size] [-m message] [-p percentage] "
|
||||||
"[-s style] [-S active-border-style] "
|
"[-s style] [-S active-border-style] "
|
||||||
@@ -201,6 +201,8 @@ cmd_split_window_exec(struct cmd *self, struct cmdq_item *item)
|
|||||||
*/
|
*/
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
if (args_has(args, 'C') && args_has(args, 'O'))
|
||||||
|
new_wp->flags |= PANE_CLOSEONCLICK;
|
||||||
|
|
||||||
style = args_get(args, 's');
|
style = args_get(args, 's');
|
||||||
if (style != NULL) {
|
if (style != NULL) {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/* $OpenBSD: screen-redraw.c,v 1.154 2026/07/21 11:53:41 nicm Exp $ */
|
/* $OpenBSD: screen-redraw.c,v 1.155 2026/07/21 13:27:41 nicm Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2026 Nicholas Marriott <nicholas.marriott@gmail.com>
|
* Copyright (c) 2026 Nicholas Marriott <nicholas.marriott@gmail.com>
|
||||||
@@ -696,20 +696,22 @@ redraw_mark_pane_borders(struct redraw_build_ctx *bctx, struct window_pane *wp,
|
|||||||
bottom = wp->yoff + wp->sy;
|
bottom = wp->yoff + wp->sy;
|
||||||
|
|
||||||
mark_left = (left >= 0);
|
mark_left = (left >= 0);
|
||||||
mark_right = (right <= (int)bctx->w->sx);
|
|
||||||
mark_top = (top >= 0);
|
mark_top = (top >= 0);
|
||||||
mark_bottom = (bottom <= (int)bctx->w->sy);
|
|
||||||
|
|
||||||
if (floating) {
|
if (floating) {
|
||||||
|
mark_right = (right < (int)bctx->w->sx);
|
||||||
|
mark_bottom = (bottom < (int)bctx->w->sy);
|
||||||
if (left < 0)
|
if (left < 0)
|
||||||
left = 0;
|
left = 0;
|
||||||
if (right > (int)bctx->w->sx)
|
if (right >= (int)bctx->w->sx)
|
||||||
right = (int)bctx->w->sx - 1;
|
right = (int)bctx->w->sx - 1;
|
||||||
if (top < 0)
|
if (top < 0)
|
||||||
top = 0;
|
top = 0;
|
||||||
if (bottom > (int)bctx->w->sy)
|
if (bottom >= (int)bctx->w->sy)
|
||||||
bottom = (int)bctx->w->sy - 1;
|
bottom = (int)bctx->w->sy - 1;
|
||||||
} else {
|
} else {
|
||||||
|
mark_right = (right <= (int)bctx->w->sx);
|
||||||
|
mark_bottom = (bottom <= (int)bctx->w->sy);
|
||||||
if (pane_status == PANE_STATUS_TOP)
|
if (pane_status == PANE_STATUS_TOP)
|
||||||
mark_bottom = 0;
|
mark_bottom = 0;
|
||||||
else if (pane_status == PANE_STATUS_BOTTOM)
|
else if (pane_status == PANE_STATUS_BOTTOM)
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/* $OpenBSD: server-client.c,v 1.497 2026/07/17 12:42:51 nicm Exp $ */
|
/* $OpenBSD: server-client.c,v 1.498 2026/07/21 12:28:43 nicm Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2009 Nicholas Marriott <nicholas.marriott@gmail.com>
|
* Copyright (c) 2009 Nicholas Marriott <nicholas.marriott@gmail.com>
|
||||||
@@ -1057,6 +1057,11 @@ have_event:
|
|||||||
c->tty.mouse_scrolling_flag = 0;
|
c->tty.mouse_scrolling_flag = 0;
|
||||||
c->tty.mouse_slider_mpos = -1;
|
c->tty.mouse_slider_mpos = -1;
|
||||||
c->tty.mouse_last_pane = -1;
|
c->tty.mouse_last_pane = -1;
|
||||||
|
if ((w->modal->flags & PANE_CLOSEONCLICK) &&
|
||||||
|
(type == KEYC_TYPE_MOUSEDOWN ||
|
||||||
|
type == KEYC_TYPE_SECONDCLICK ||
|
||||||
|
type == KEYC_TYPE_TRIPLECLICK))
|
||||||
|
server_kill_pane(w->modal);
|
||||||
return (KEYC_UNKNOWN);
|
return (KEYC_UNKNOWN);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
7
tmux.1
7
tmux.1
@@ -1,4 +1,4 @@
|
|||||||
.\" $OpenBSD: tmux.1,v 1.1145 2026/07/21 11:52:13 nicm Exp $
|
.\" $OpenBSD: tmux.1,v 1.1146 2026/07/21 12:28:43 nicm Exp $
|
||||||
.\"
|
.\"
|
||||||
.\" Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
|
.\" Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
|
||||||
.\"
|
.\"
|
||||||
@@ -3638,7 +3638,7 @@ but a different format may be specified with
|
|||||||
.Fl F .
|
.Fl F .
|
||||||
.Tg newp
|
.Tg newp
|
||||||
.It Xo Ic new\-pane
|
.It Xo Ic new\-pane
|
||||||
.Op Fl bdefhIkLMOPvWZ
|
.Op Fl bCdefhIkLMOPvWZ
|
||||||
.Op Fl B Ar border\-lines
|
.Op Fl B Ar border\-lines
|
||||||
.Op Fl c Ar start\-directory
|
.Op Fl c Ar start\-directory
|
||||||
.Op Fl e Ar environment
|
.Op Fl e Ar environment
|
||||||
@@ -3694,6 +3694,9 @@ creates a modal pane.
|
|||||||
A modal pane is always the active pane and prevents interaction with any other
|
A modal pane is always the active pane and prevents interaction with any other
|
||||||
panes while it is active.
|
panes while it is active.
|
||||||
A window can only have one modal pane and it must be a floating pane.
|
A window can only have one modal pane and it must be a floating pane.
|
||||||
|
With
|
||||||
|
.Fl C ,
|
||||||
|
the modal pane is closed when the mouse is clicked outside it.
|
||||||
.Pp
|
.Pp
|
||||||
The
|
The
|
||||||
.Fl L
|
.Fl L
|
||||||
|
|||||||
3
tmux.h
3
tmux.h
@@ -1,4 +1,4 @@
|
|||||||
/* $OpenBSD: tmux.h,v 1.1411 2026/07/20 11:16:33 nicm Exp $ */
|
/* $OpenBSD: tmux.h,v 1.1412 2026/07/21 12:28:43 nicm Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
|
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
|
||||||
@@ -1332,6 +1332,7 @@ struct window_pane {
|
|||||||
#define PANE_DESTROYED 0x10000
|
#define PANE_DESTROYED 0x10000
|
||||||
#define PANE_CMDRUNNING 0x20000
|
#define PANE_CMDRUNNING 0x20000
|
||||||
#define PANE_ACTIVITY 0x40000
|
#define PANE_ACTIVITY 0x40000
|
||||||
|
#define PANE_CLOSEONCLICK 0x80000
|
||||||
|
|
||||||
bitstr_t *sync_dirty;
|
bitstr_t *sync_dirty;
|
||||||
u_int sync_dirty_size;
|
u_int sync_dirty_size;
|
||||||
|
|||||||
4
window.c
4
window.c
@@ -1,4 +1,4 @@
|
|||||||
/* $OpenBSD: window.c,v 1.366 2026/07/19 19:53:11 nicm Exp $ */
|
/* $OpenBSD: window.c,v 1.367 2026/07/21 13:04:01 nicm Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
|
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
|
||||||
@@ -571,13 +571,13 @@ window_resize(struct window *w, u_int sx, u_int sy, int xpixel, int ypixel)
|
|||||||
w->sy = sy;
|
w->sy = sy;
|
||||||
if (w->menu != NULL) {
|
if (w->menu != NULL) {
|
||||||
menu_resize(w->menu, w);
|
menu_resize(w->menu, w);
|
||||||
redraw_invalidate_scene(w);
|
|
||||||
server_redraw_window(w);
|
server_redraw_window(w);
|
||||||
}
|
}
|
||||||
if (xpixel != -1)
|
if (xpixel != -1)
|
||||||
w->xpixel = xpixel;
|
w->xpixel = xpixel;
|
||||||
if (ypixel != -1)
|
if (ypixel != -1)
|
||||||
w->ypixel = ypixel;
|
w->ypixel = ypixel;
|
||||||
|
redraw_invalidate_scene(w);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|||||||
Reference in New Issue
Block a user