From: Jan Djärv Date: Sun, 5 Oct 2014 15:46:10 +0000 (+0200) Subject: * nsterm.m (ns_draw_window_cursor): Adjust y for hbar cursor only if smaller than X-Git-Tag: emacs-25.0.90~2635^2~679^2~119 X-Git-Url: https://code.delx.au/gnu-emacs/commitdiff_plain/6e604a82a0f8dad3a55c54cf8b64ef2d38106f5b * nsterm.m (ns_draw_window_cursor): Adjust y for hbar cursor only if smaller than line height (Bug#17977). Fixes: debbugs:18345 --- diff --git a/src/ChangeLog b/src/ChangeLog index 77494c0dc4..835a241cf9 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 332b7cc0b7..ea8b4f726f 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; } }