From 6e604a82a0f8dad3a55c54cf8b64ef2d38106f5b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20Dj=C3=A4rv?= Date: Sun, 5 Oct 2014 17:46:10 +0200 Subject: [PATCH] * nsterm.m (ns_draw_window_cursor): Adjust y for hbar cursor only if smaller than line height (Bug#17977). Fixes: debbugs:18345 --- src/ChangeLog | 2 ++ src/nsterm.m | 7 +++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 77494c0dc42..835a241cf9d 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -4,6 +4,8 @@ (toggleFullScreen:): Use ns-use-fullscreen-animation for animate. (ns_select, ns_read_socket): Use unwind_protect to decrease apploopnr (Bug#18345). + (ns_draw_window_cursor): Adjust y for hbar cursor only if smaller than + line height (Bug#17977). * macfont.m: Fix indentation and import changes from macport 24.3.94. diff --git a/src/nsterm.m b/src/nsterm.m index 332b7cc0b78..ea8b4f726ff 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -2441,7 +2441,10 @@ ns_draw_window_cursor (struct window *w, struct glyph_row *glyph_row, else if (cursor_type == HBAR_CURSOR) { cursor_height = (cursor_width < 1) ? lrint (0.25 * h) : cursor_width; - fy += h - cursor_height; + if (cursor_height > glyph_row->height) + cursor_height = glyph_row->height; + if (h > cursor_height) // Cursor smaller than line height, move down + fy += h - cursor_height; h = cursor_height; } @@ -6884,7 +6887,7 @@ if (cols > 0 && rows > 0) } else { - error ("Invalid data type in dragging pasteboard"); + fprintf (stderr, "Invalid data type in dragging pasteboard"); return NO; } } -- 2.39.5