diff options
| author | Eli Zaretskii <eliz@gnu.org> | 2014-10-18 16:09:18 +0300 |
|---|---|---|
| committer | Eli Zaretskii <eliz@gnu.org> | 2014-10-18 16:09:18 +0300 |
| commit | a4c80e35cc48376a3e35b11ee41cf3859b93efd5 (patch) | |
| tree | e8f5965310768d4e5668d6c051fabf3a60ef115a /src | |
| parent | 6b247d287327777dfd29e20eac177c2005e99b45 (diff) | |
| download | emacs-a4c80e35cc48376a3e35b11ee41cf3859b93efd5.tar.gz | |
A better fix for drawing hollow cursor on X on 1-pixel thin space characters.
src/xterm.c (x_draw_bar_cursor, x_draw_hollow_cursor): Subtract 1
pixel from the window's cursor glyph width, since X renders hollow
blocks 1 pixel wider than the 'width' parameter.
src/xdisp.c (get_phys_cursor_geometry): Don't subtract 1 pixel from
glyph->pixel_width; this is now done in xterm.c.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 7 | ||||
| -rw-r--r-- | src/xdisp.c | 5 | ||||
| -rw-r--r-- | src/xterm.c | 12 |
3 files changed, 14 insertions, 10 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 66306bd5fb6..a28ae469001 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,12 @@ 2014-10-18 Eli Zaretskii <eliz@gnu.org> + * xterm.c (x_draw_bar_cursor, x_draw_hollow_cursor): Subtract 1 + pixel from the window's cursor glyph width, since X renders hollow + blocks 1 pixel wider than the 'width' parameter. + + * xdisp.c (get_phys_cursor_geometry): Don't subtract 1 pixel from + glyph->pixel_width; this is now done in xterm.c. + Fix reordering of bracket characters in isolates. * bidi.c (bidi_cache_find): Rename the argument NEUTRALS_OK to RESOLVED_ONLY; when non-zero, return from the cache only fully diff --git a/src/xdisp.c b/src/xdisp.c index 7c3aaa2042e..ad28dacf4e5 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -2302,10 +2302,7 @@ get_phys_cursor_geometry (struct window *w, struct glyph_row *row, glyph, and `x-stretch-block-cursor' is nil, don't draw a rectangle as wide as the glyph, but use a canonical character width instead. */ - wd = glyph->pixel_width - 1; -#if defined (HAVE_NTGUI) || defined (HAVE_NS) - wd++; /* Why? */ -#endif + wd = glyph->pixel_width; x = w->phys_cursor.x; if (x < 0) diff --git a/src/xterm.c b/src/xterm.c index 334eafcd3fe..a1e338b54ee 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -7965,7 +7965,7 @@ x_draw_hollow_cursor (struct window *w, struct glyph_row *row) /* Compute frame-relative coordinates for phys cursor. */ get_phys_cursor_geometry (w, row, cursor_glyph, &x, &y, &h); - wd = w->phys_cursor_width; + wd = w->phys_cursor_width - 1; /* The foreground of cursor_gc is typically the same as the normal background color, which can cause the cursor box to be invisible. */ @@ -7981,9 +7981,9 @@ x_draw_hollow_cursor (struct window *w, struct glyph_row *row) glyph, unless the cursor box is as wide as the glyph or wider (the latter happens when x-stretch-cursor is non-nil). */ if ((cursor_glyph->resolved_level & 1) != 0 - && cursor_glyph->pixel_width > w->phys_cursor_width) + && cursor_glyph->pixel_width > wd) { - x += cursor_glyph->pixel_width - w->phys_cursor_width; + x += cursor_glyph->pixel_width - wd; if (wd > 0) wd -= 1; } @@ -8086,12 +8086,12 @@ x_draw_bar_cursor (struct window *w, struct glyph_row *row, int width, enum text &dummy_y, &dummy_h); if ((cursor_glyph->resolved_level & 1) != 0 - && cursor_glyph->pixel_width > w->phys_cursor_width) - x += cursor_glyph->pixel_width - w->phys_cursor_width; + && cursor_glyph->pixel_width > w->phys_cursor_width - 1) + x += cursor_glyph->pixel_width - w->phys_cursor_width + 1; XFillRectangle (dpy, window, gc, x, WINDOW_TO_FRAME_PIXEL_Y (w, w->phys_cursor.y + row->height - width), - w->phys_cursor_width, width); + w->phys_cursor_width - 1, width); } XSetClipMask (dpy, gc, None); |
