Merge branch 'obsd-master'

This commit is contained in:
Thomas Adam
2024-11-15 16:01:11 +00:00
10 changed files with 190 additions and 66 deletions

View File

@ -577,7 +577,7 @@ server_client_check_mouse(struct client *c, struct key_event *event)
struct window_pane *wp, *fwp;
u_int x, y, b, sx, sy, px, py, line = 0, sb_pos;
u_int sl_top, sl_bottom, sl_mpos = 0;
int ignore = 0, sb, sb_w, pane_status;
int ignore = 0, sb, sb_w, sb_pad, pane_status;
key_code key;
struct timeval tv;
struct style_range *sr;
@ -779,10 +779,15 @@ have_event:
/* Try the scrollbar next to a pane. */
sb = options_get_number(wo, "pane-scrollbars");
if (window_pane_show_scrollbar(wp, sb))
sb_w = PANE_SCROLLBARS_WIDTH;
else
sb_pos = options_get_number(wo,
"pane-scrollbars-position");
if (window_pane_show_scrollbar(wp, sb)) {
sb_w = wp->scrollbar_style.width;
sb_pad = wp->scrollbar_style.pad;
} else {
sb_w = 0;
sb_pad = 0;
}
pane_status = options_get_number(wo,
"pane-border-status");
if (pane_status == PANE_STATUS_TOP)
@ -791,8 +796,9 @@ have_event:
line = wp->yoff + wp->sy;
/*
* Check if py could lie within a scrollbar. If the
* pane is at the top, then py is 0; if not then the
* Check if py could lie within a scrollbar
* (but not within the padding). If the pane is
* at the top, then py is 0; if not then the
* top, then yoff to yoff + sy.
*/
if ((pane_status != PANE_STATUS_OFF && py != line) ||
@ -801,11 +807,11 @@ have_event:
sb_pos = options_get_number(wo,
"pane-scrollbars-position");
if ((sb_pos == PANE_SCROLLBARS_RIGHT &&
(px >= wp->xoff + wp->sx &&
px < wp->xoff + wp->sx + sb_w)) ||
(px >= wp->xoff + wp->sx + sb_pad &&
px < wp->xoff + wp->sx + sb_pad + sb_w)) ||
(sb_pos == PANE_SCROLLBARS_LEFT &&
(px >= wp->xoff - sb_w &&
px < wp->xoff))) {
(px >= wp->xoff - sb_pad - sb_w &&
px < wp->xoff - sb_pad))) {
sl_top = wp->yoff + wp->sb_slider_y;
sl_bottom = (wp->yoff +
wp->sb_slider_y +
@ -3678,6 +3684,8 @@ server_client_set_flags(struct client *c, const char *flags)
flag = CLIENT_IGNORESIZE;
else if (strcmp(next, "active-pane") == 0)
flag = CLIENT_ACTIVEPANE;
else if (strcmp(next, "no-detach-on-destroy") == 0)
flag = CLIENT_NO_DETACH_ON_DESTROY;
if (flag == 0)
continue;
@ -3711,6 +3719,8 @@ server_client_get_flags(struct client *c)
strlcat(s, "control-mode,", sizeof s);
if (c->flags & CLIENT_IGNORESIZE)
strlcat(s, "ignore-size,", sizeof s);
if (c->flags & CLIENT_NO_DETACH_ON_DESTROY)
strlcat(s, "no-detach-on-destroy,", sizeof s);
if (c->flags & CLIENT_CONTROL_NOOUTPUT)
strlcat(s, "no-output,", sizeof s);
if (c->flags & CLIENT_CONTROL_WAITEXIT)