]> code.delx.au - gnu-emacs/commitdiff
* nsterm.m (ns_draw_window_cursor): Adjust y for hbar cursor only if smaller than
authorJan Djärv <jan.h.d@swipnet.se>
Sun, 5 Oct 2014 15:46:10 +0000 (17:46 +0200)
committerJan Djärv <jan.h.d@swipnet.se>
Sun, 5 Oct 2014 15:46:10 +0000 (17:46 +0200)
line height (Bug#17977).

Fixes: debbugs:18345
src/ChangeLog
src/nsterm.m

index 77494c0dc4223c247bef21b7203d13d6605b1d3d..835a241cf9dd8fe0928e12d5e30fcd6ff777c8cc 100644 (file)
@@ -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.
index 332b7cc0b78d862c0f7140f9799ea1e6022c2157..ea8b4f726ff96f47aafbfaa307357006d4971453 100644 (file)
@@ -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;
     }
 }