diff options
| -rw-r--r-- | src/xdisp.c | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/src/xdisp.c b/src/xdisp.c index 4144cf51f6a..87fa20fc064 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -21213,9 +21213,30 @@ get_window_cursor_type (w, glyph, width, active_cursor) | |||
| 21213 | /* Use normal cursor if not blinked off. */ | 21213 | /* Use normal cursor if not blinked off. */ |
| 21214 | if (!w->cursor_off_p) | 21214 | if (!w->cursor_off_p) |
| 21215 | { | 21215 | { |
| 21216 | if (glyph != NULL && glyph->type == IMAGE_GLYPH) { | 21216 | if (glyph != NULL && glyph->type == IMAGE_GLYPH) |
| 21217 | if (cursor_type == FILLED_BOX_CURSOR) | 21217 | { |
| 21218 | cursor_type = HOLLOW_BOX_CURSOR; | 21218 | if (cursor_type == FILLED_BOX_CURSOR) |
| 21219 | { | ||
| 21220 | /* Using a block cursor on large images can be very annoying. | ||
| 21221 | So use a hollow cursor for "large" images. */ | ||
| 21222 | struct image *img = IMAGE_FROM_ID (f, glyph->u.img_id); | ||
| 21223 | if (img != NULL && IMAGEP (img->spec)) | ||
| 21224 | { | ||
| 21225 | /* Arbitrarily, interpret "Large" as >32x32 and >NxN | ||
| 21226 | where N = size of default frame font size. | ||
| 21227 | This should cover most of the "tiny" icons people may use. */ | ||
| 21228 | if (img->width > max (32, WINDOW_FRAME_COLUMN_WIDTH (w)) | ||
| 21229 | || img->height > max (32, WINDOW_FRAME_LINE_HEIGHT (w))) | ||
| 21230 | cursor_type = HOLLOW_BOX_CURSOR; | ||
| 21231 | } | ||
| 21232 | } | ||
| 21233 | else if (cursor_type != NO_CURSOR) | ||
| 21234 | { | ||
| 21235 | /* Display current only supports BOX and HOLLOW cursors for images. | ||
| 21236 | So for now, unconditionally use a HOLLOW cursor when cursor is | ||
| 21237 | not a solid box cursor. */ | ||
| 21238 | cursor_type = HOLLOW_BOX_CURSOR; | ||
| 21239 | } | ||
| 21219 | } | 21240 | } |
| 21220 | return cursor_type; | 21241 | return cursor_type; |
| 21221 | } | 21242 | } |