mirror of
https://github.com/tmux/tmux.git
synced 2025-12-20 00:01:17 -05:00
Add support for clicking on a floating pane border to make it active. Including bugfix to click bottom border of floating panes.
This commit is contained in:
parent
9c45dd693b
commit
329e9d54ab
@ -86,6 +86,8 @@ cmd_resize_pane_exec(struct cmd *self, struct cmdq_item *item)
|
||||
c->tty.mouse_drag_update = cmd_resize_pane_mouse_update_tiled;
|
||||
cmd_resize_pane_mouse_update_tiled(c, &event->m);
|
||||
} else {
|
||||
window_redraw_active_switch(w, c->tty.mouse_wp);
|
||||
window_set_active_pane(w, c->tty.mouse_wp, 1);
|
||||
c->tty.mouse_drag_update = cmd_resize_pane_mouse_update_floating;
|
||||
cmd_resize_pane_mouse_update_floating(c, &event->m);
|
||||
}
|
||||
|
||||
@ -160,6 +160,10 @@ cmd_select_pane_exec(struct cmd *self, struct cmdq_item *item)
|
||||
server_redraw_window_borders(markedwp->window);
|
||||
server_status_window(markedwp->window);
|
||||
}
|
||||
if (wp->layout_cell == NULL) {
|
||||
window_redraw_active_switch(w, wp);
|
||||
window_set_active_pane(w, wp, 1);
|
||||
}
|
||||
return (CMD_RETURN_NORMAL);
|
||||
}
|
||||
|
||||
|
||||
@ -455,6 +455,9 @@ key_bindings_init(void)
|
||||
/* Mouse button 1 triple click on pane. */
|
||||
"bind -n TripleClick1Pane { select-pane -t=; if -F '#{||:#{pane_in_mode},#{mouse_any_flag}}' { send -M } { copy-mode -H; send -X select-line; run -d0.3; send -X copy-pipe-and-cancel } }",
|
||||
|
||||
/* Mouse button 1 on border. */
|
||||
"bind -n MouseDown1Border { select-pane -M }",
|
||||
|
||||
/* Mouse button 1 drag on border. */
|
||||
"bind -n MouseDrag1Border { resize-pane -M }",
|
||||
|
||||
|
||||
@ -606,7 +606,7 @@ server_client_check_mouse_in_pane(struct window_pane *wp, u_int px, u_int py,
|
||||
sb_pad = 0;
|
||||
}
|
||||
/* xxxx isn't this only for tiled panes at the top or bottom of the window? */
|
||||
if (pane_status == PANE_STATUS_TOP)
|
||||
if (pane_status == PANE_STATUS_TOP && wp->layout_cell != NULL)
|
||||
line = wp->yoff - 1;
|
||||
else if (pane_status == PANE_STATUS_BOTTOM)
|
||||
line = wp->yoff + wp->sy;
|
||||
@ -639,8 +639,10 @@ server_client_check_mouse_in_pane(struct window_pane *wp, u_int px, u_int py,
|
||||
} else /* py > sl_bottom */
|
||||
return (SCROLLBAR_DOWN);
|
||||
} else if (wp->layout_cell == NULL &&
|
||||
((int)px == wp->xoff - 1 || (int)py == wp->yoff -1)) {
|
||||
/* Floating pane left or top border. */
|
||||
((int)px == wp->xoff - 1 ||
|
||||
(int)py == wp->yoff -1 ||
|
||||
(int)py == wp->yoff + (int)wp->sy)) {
|
||||
/* Floating pane left, bottom or top border. */
|
||||
return (BORDER);
|
||||
} else {
|
||||
/* Must be inside the pane. */
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user