diff options
-rw-r--r-- | cmd-resize-pane.c | 8 | ||||
-rw-r--r-- | cmd.c | 4 | ||||
-rw-r--r-- | server-client.c | 7 |
3 files changed, 10 insertions, 9 deletions
diff --git a/cmd-resize-pane.c b/cmd-resize-pane.c index c978edfb..8d35d96f 100644 --- a/cmd-resize-pane.c +++ b/cmd-resize-pane.c @@ -144,13 +144,13 @@ cmd_resize_pane_mouse_update(struct client *c, struct mouse_event *m) w = wl->window; y = m->y + m->oy; x = m->x + m->ox; - if (m->statusat == 0 && y > 0) - y--; + if (m->statusat == 0 && y >= m->statuslines) + y -= m->statuslines; else if (m->statusat > 0 && y >= (u_int)m->statusat) y = m->statusat - 1; ly = m->ly + m->oy; lx = m->lx + m->ox; - if (m->statusat == 0 && ly > 0) - ly--; + if (m->statusat == 0 && ly >= m->statuslines) + ly -= m->statuslines; else if (m->statusat > 0 && ly >= (u_int)m->statusat) ly = m->statusat - 1; @@ -597,8 +597,8 @@ cmd_mouse_at(struct window_pane *wp, struct mouse_event *m, u_int *xp, } log_debug("%s: x=%u, y=%u%s", __func__, x, y, last ? " (last)" : ""); - if (m->statusat == 0 && y > 0) - y--; + if (m->statusat == 0 && y >= m->statuslines) + y -= m->statuslines; if (x < wp->xoff || x >= wp->xoff + wp->sx) return (-1); diff --git a/server-client.c b/server-client.c index 7aeead41..3fd16ec5 100644 --- a/server-client.c +++ b/server-client.c @@ -524,9 +524,10 @@ have_event: /* Is this on the status line? */ m->statusat = status_at_line(c); + m->statuslines = status_line_size(c); if (m->statusat != -1 && y >= (u_int)m->statusat && - y < m->statusat + status_line_size(c)) { + y < m->statusat + m->statuslines) { sr = status_get_range(c, x, y - m->statusat); if (sr == NULL) { where = STATUS_DEFAULT; @@ -555,8 +556,8 @@ have_event: /* Not on status line. Adjust position and check for border or pane. */ if (where == NOWHERE) { px = x; - if (m->statusat == 0 && y > 0) - py = y - 1; + if (m->statusat == 0 && y >= m->statuslines) + py = y - m->statuslines; else if (m->statusat > 0 && y >= (u_int)m->statusat) py = m->statusat - 1; else |