Add mouse detection on top & left borders of floating panes.

This commit is contained in:
Michael Grant
2025-10-23 23:25:48 +01:00
parent baf642b7d2
commit b315a6c3d1
2 changed files with 47 additions and 12 deletions

View File

@@ -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);