mirror of
https://github.com/tmux/tmux.git
synced 2026-01-12 09:20:22 +00:00
Fix dragging a window to y==0 when pane border status enabled. window_get_active_at() needs to return the pane at the top of the window when called with y==0, otherwise it returns null as if there is no pane at the top line.
This commit is contained in:
9
window.c
9
window.c
@@ -605,9 +605,11 @@ struct window_pane *
|
|||||||
window_get_active_at(struct window *w, u_int x, u_int y)
|
window_get_active_at(struct window *w, u_int x, u_int y)
|
||||||
{
|
{
|
||||||
struct window_pane *wp;
|
struct window_pane *wp;
|
||||||
int xoff, yoff;
|
int status, xoff, yoff;
|
||||||
u_int sx, sy;
|
u_int sx, sy;
|
||||||
|
|
||||||
|
status = options_get_number(w->options, "pane-border-status");
|
||||||
|
|
||||||
TAILQ_FOREACH(wp, &w->z_index, zentry) {
|
TAILQ_FOREACH(wp, &w->z_index, zentry) {
|
||||||
if (!window_pane_visible(wp))
|
if (!window_pane_visible(wp))
|
||||||
continue;
|
continue;
|
||||||
@@ -617,8 +619,13 @@ window_get_active_at(struct window *w, u_int x, u_int y)
|
|||||||
right border. */
|
right border. */
|
||||||
if ((int)x < xoff || x > xoff + sx)
|
if ((int)x < xoff || x > xoff + sx)
|
||||||
continue;
|
continue;
|
||||||
|
if (status == PANE_STATUS_TOP) {
|
||||||
|
if ((int)y < yoff - 1 || y > yoff + sy)
|
||||||
|
continue;
|
||||||
|
} else {
|
||||||
if ((int)y < yoff || y > yoff + sy)
|
if ((int)y < yoff || y > yoff + sy)
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
/* Floating, include top or or left border. */
|
/* Floating, include top or or left border. */
|
||||||
if ((int)x < xoff - 1 || x > xoff + sx)
|
if ((int)x < xoff - 1 || x > xoff + sx)
|
||||||
|
|||||||
Reference in New Issue
Block a user