diff options
| author | Po Lu | 2022-02-07 03:00:25 +0000 |
|---|---|---|
| committer | Po Lu | 2022-02-07 03:00:25 +0000 |
| commit | ab5b2e63fa0b966570cc505fa4a77d16cf3f45d6 (patch) | |
| tree | a4a5f3b9fdc8fb262d455979b78fd7aa3c6734fa /src | |
| parent | e9217d0f348ec1be6950630795ff940f5b556f8e (diff) | |
| download | emacs-ab5b2e63fa0b966570cc505fa4a77d16cf3f45d6.tar.gz emacs-ab5b2e63fa0b966570cc505fa4a77d16cf3f45d6.zip | |
Respect `x-cursor-fore-pixel' on Haiku
* src/haikufns.c (haiku_set_cursor_color): Respect
`x-cursor-fore-pixel'.
(syms_of_haikufns): Declare variable `x-cursor-fore-pixel'.
Diffstat (limited to 'src')
| -rw-r--r-- | src/haikufns.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/haikufns.c b/src/haikufns.c index eb736f1153d..8aad2cbd7f0 100644 --- a/src/haikufns.c +++ b/src/haikufns.c | |||
| @@ -1393,7 +1393,7 @@ haiku_set_cursor_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval) | |||
| 1393 | CHECK_STRING (arg); | 1393 | CHECK_STRING (arg); |
| 1394 | 1394 | ||
| 1395 | block_input (); | 1395 | block_input (); |
| 1396 | Emacs_Color color; | 1396 | Emacs_Color color, fore_pixel; |
| 1397 | 1397 | ||
| 1398 | if (haiku_get_color (SSDATA (arg), &color)) | 1398 | if (haiku_get_color (SSDATA (arg), &color)) |
| 1399 | { | 1399 | { |
| @@ -1403,6 +1403,17 @@ haiku_set_cursor_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval) | |||
| 1403 | } | 1403 | } |
| 1404 | 1404 | ||
| 1405 | FRAME_CURSOR_COLOR (f) = color; | 1405 | FRAME_CURSOR_COLOR (f) = color; |
| 1406 | |||
| 1407 | if (STRINGP (Vx_cursor_fore_pixel)) | ||
| 1408 | { | ||
| 1409 | if (haiku_get_color (SSDATA (Vx_cursor_fore_pixel), | ||
| 1410 | &fore_pixel)) | ||
| 1411 | error ("Bad color %s", Vx_cursor_fore_pixel); | ||
| 1412 | FRAME_OUTPUT_DATA (f)->cursor_fg = fore_pixel.pixel; | ||
| 1413 | } | ||
| 1414 | else | ||
| 1415 | FRAME_OUTPUT_DATA (f)->cursor_fg = FRAME_BACKGROUND_PIXEL (f); | ||
| 1416 | |||
| 1406 | if (FRAME_VISIBLE_P (f)) | 1417 | if (FRAME_VISIBLE_P (f)) |
| 1407 | { | 1418 | { |
| 1408 | gui_update_cursor (f, 0); | 1419 | gui_update_cursor (f, 0); |
| @@ -2685,6 +2696,10 @@ syms_of_haikufns (void) | |||
| 2685 | doc: /* SKIP: real doc in xfns.c. */); | 2696 | doc: /* SKIP: real doc in xfns.c. */); |
| 2686 | Vx_max_tooltip_size = Fcons (make_fixnum (80), make_fixnum (40)); | 2697 | Vx_max_tooltip_size = Fcons (make_fixnum (80), make_fixnum (40)); |
| 2687 | 2698 | ||
| 2699 | DEFVAR_LISP ("x-cursor-fore-pixel", Vx_cursor_fore_pixel, | ||
| 2700 | doc: /* SKIP: real doc in xfns.c. */); | ||
| 2701 | Vx_cursor_fore_pixel = Qnil; | ||
| 2702 | |||
| 2688 | #ifdef USE_BE_CAIRO | 2703 | #ifdef USE_BE_CAIRO |
| 2689 | DEFVAR_LISP ("cairo-version-string", Vcairo_version_string, | 2704 | DEFVAR_LISP ("cairo-version-string", Vcairo_version_string, |
| 2690 | doc: /* Version info for cairo. */); | 2705 | doc: /* Version info for cairo. */); |