diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 5 | ||||
| -rw-r--r-- | src/nsterm.m | 18 |
2 files changed, 20 insertions, 3 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 2db05fd1722..c6e0d92f1f5 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2010-12-16 Jan Djärv <jan.h.d@swipnet.se> | ||
| 2 | |||
| 3 | * nsterm.m (ns_draw_window_cursor): If the cursor color is the | ||
| 4 | same as the background, use the face forground as cursor. | ||
| 5 | |||
| 1 | 2010-12-13 Eli Zaretskii <eliz@gnu.org> | 6 | 2010-12-13 Eli Zaretskii <eliz@gnu.org> |
| 2 | 7 | ||
| 3 | * fileio.c (Fexpand_file_name): Doc fix. (Bug#7617) | 8 | * fileio.c (Fexpand_file_name): Doc fix. (Bug#7617) |
diff --git a/src/nsterm.m b/src/nsterm.m index 87dc1195425..c33253049c1 100644 --- a/src/nsterm.m +++ b/src/nsterm.m | |||
| @@ -2301,6 +2301,8 @@ ns_draw_window_cursor (struct window *w, struct glyph_row *glyph_row, | |||
| 2301 | struct glyph *phys_cursor_glyph; | 2301 | struct glyph *phys_cursor_glyph; |
| 2302 | int overspill; | 2302 | int overspill; |
| 2303 | struct glyph *cursor_glyph; | 2303 | struct glyph *cursor_glyph; |
| 2304 | struct face *face; | ||
| 2305 | NSColor *hollow_color = FRAME_BACKGROUND_COLOR (f); | ||
| 2304 | 2306 | ||
| 2305 | /* If cursor is out of bounds, don't draw garbage. This can happen | 2307 | /* If cursor is out of bounds, don't draw garbage. This can happen |
| 2306 | in mini-buffer windows when switching between echo area glyphs | 2308 | in mini-buffer windows when switching between echo area glyphs |
| @@ -2310,7 +2312,7 @@ ns_draw_window_cursor (struct window *w, struct glyph_row *glyph_row, | |||
| 2310 | //fprintf(stderr, "drawcursor (%d,%d) activep = %d\tonp = %d\tc_type = %d\twidth = %d\n",x,y, active_p,on_p,cursor_type,cursor_width); | 2312 | //fprintf(stderr, "drawcursor (%d,%d) activep = %d\tonp = %d\tc_type = %d\twidth = %d\n",x,y, active_p,on_p,cursor_type,cursor_width); |
| 2311 | 2313 | ||
| 2312 | if (!on_p) | 2314 | if (!on_p) |
| 2313 | return; | 2315 | return; |
| 2314 | 2316 | ||
| 2315 | w->phys_cursor_type = cursor_type; | 2317 | w->phys_cursor_type = cursor_type; |
| 2316 | w->phys_cursor_on_p = on_p; | 2318 | w->phys_cursor_on_p = on_p; |
| @@ -2349,7 +2351,17 @@ ns_draw_window_cursor (struct window *w, struct glyph_row *glyph_row, | |||
| 2349 | /* TODO: only needed in rare cases with last-resort font in HELLO.. | 2351 | /* TODO: only needed in rare cases with last-resort font in HELLO.. |
| 2350 | should we do this more efficiently? */ | 2352 | should we do this more efficiently? */ |
| 2351 | ns_clip_to_row (w, glyph_row, -1, NO); /* do ns_focus(f, &r, 1); if remove */ | 2353 | ns_clip_to_row (w, glyph_row, -1, NO); /* do ns_focus(f, &r, 1); if remove */ |
| 2352 | [FRAME_CURSOR_COLOR (f) set]; | 2354 | |
| 2355 | |||
| 2356 | face = FACE_FROM_ID (f, phys_cursor_glyph->face_id); | ||
| 2357 | if (face && NS_FACE_BACKGROUND (face) | ||
| 2358 | == ns_index_color (FRAME_CURSOR_COLOR (f), f)) | ||
| 2359 | { | ||
| 2360 | [ns_lookup_indexed_color (NS_FACE_FOREGROUND (face), f) set]; | ||
| 2361 | hollow_color = FRAME_CURSOR_COLOR (f); | ||
| 2362 | } | ||
| 2363 | else | ||
| 2364 | [FRAME_CURSOR_COLOR (f) set]; | ||
| 2353 | 2365 | ||
| 2354 | #ifdef NS_IMPL_COCOA | 2366 | #ifdef NS_IMPL_COCOA |
| 2355 | /* TODO: This makes drawing of cursor plus that of phys_cursor_glyph | 2367 | /* TODO: This makes drawing of cursor plus that of phys_cursor_glyph |
| @@ -2369,7 +2381,7 @@ ns_draw_window_cursor (struct window *w, struct glyph_row *glyph_row, | |||
| 2369 | break; | 2381 | break; |
| 2370 | case HOLLOW_BOX_CURSOR: | 2382 | case HOLLOW_BOX_CURSOR: |
| 2371 | NSRectFill (r); | 2383 | NSRectFill (r); |
| 2372 | [FRAME_BACKGROUND_COLOR (f) set]; | 2384 | [hollow_color set]; |
| 2373 | NSRectFill (NSInsetRect (r, 1, 1)); | 2385 | NSRectFill (NSInsetRect (r, 1, 1)); |
| 2374 | [FRAME_CURSOR_COLOR (f) set]; | 2386 | [FRAME_CURSOR_COLOR (f) set]; |
| 2375 | break; | 2387 | break; |