mirror of
https://github.com/tmux/tmux.git
synced 2026-01-11 16:30:22 +00:00
Add mouse detection on top & left borders of floating panes.
This commit is contained in:
18
window.c
18
window.c
@@ -604,10 +604,20 @@ window_get_active_at(struct window *w, u_int x, u_int y)
|
||||
if (!window_pane_visible(wp))
|
||||
continue;
|
||||
window_pane_full_size_offset(wp, &xoff, &yoff, &sx, &sy);
|
||||
if (x < xoff || x > xoff + sx)
|
||||
continue;
|
||||
if (y < yoff || y > yoff + sy)
|
||||
continue;
|
||||
if (wp->layout_cell != NULL) {
|
||||
/* Tiled, select up to including bottom or
|
||||
right border. */
|
||||
if (x < xoff || x > xoff + sx)
|
||||
continue;
|
||||
if (y < yoff || y > yoff + sy)
|
||||
continue;
|
||||
} else {
|
||||
/* Floating, include top or or left border. */
|
||||
if (x < xoff - 1 || x > xoff + sx)
|
||||
continue;
|
||||
if (y < yoff - 1 || y > yoff + sy)
|
||||
continue;
|
||||
}
|
||||
return (wp);
|
||||
}
|
||||
return (NULL);
|
||||
|
||||
Reference in New Issue
Block a user