diff options
| author | Karoly Lorentey | 2006-04-01 16:11:29 +0000 |
|---|---|---|
| committer | Karoly Lorentey | 2006-04-01 16:11:29 +0000 |
| commit | ce593f6e6b85e58206264cad983c796ce8dd41a2 (patch) | |
| tree | 3596abcaa0164629aec976947c1507924fd0e44b /src | |
| parent | b97a79c4f5c17abca8cb66e52927d524c5e1ef62 (diff) | |
| download | emacs-ce593f6e6b85e58206264cad983c796ce8dd41a2.tar.gz emacs-ce593f6e6b85e58206264cad983c796ce8dd41a2.zip | |
Fix tooltip border color.
* src/xterm.h (x_output): Remove background_pixel and foreground_pixel
fields.
* src/widget.c (update_from_various_frame_slots): Use
FRAME_BACKGROUND_PIXEL and FRAME_FOREGROUND_PIXEL.
* src/xfns.c (x_set_foreground_color): Ditto.
* src/xfns.c (x_set_background_color): Ditto.
* src/xfns.c (x_set_mouse_color): Ditto.
* src/xfns.c (x_set_cursor_color): Ditto.
* src/xfns.c (x_make_gc): Ditto.
* src/xfns.c (Fx_create_frame): Ditto.
* src/xfns.c (x_create_tip_frame): Ditto.
* src/xfns.c (build_string): Ditto.
* src/xterm.c (XTflash): Ditto.
* src/xterm.c (x_free_frame_resources): Ditto.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-544
Diffstat (limited to 'src')
| -rw-r--r-- | src/widget.c | 4 | ||||
| -rw-r--r-- | src/xfns.c | 48 | ||||
| -rw-r--r-- | src/xterm.c | 8 | ||||
| -rw-r--r-- | src/xterm.h | 2 |
4 files changed, 32 insertions, 30 deletions
diff --git a/src/widget.c b/src/widget.c index 35bf5631b20..2e9913308d0 100644 --- a/src/widget.c +++ b/src/widget.c | |||
| @@ -659,10 +659,10 @@ update_from_various_frame_slots (ew) | |||
| 659 | struct x_output *x = f->output_data.x; | 659 | struct x_output *x = f->output_data.x; |
| 660 | ew->core.height = FRAME_PIXEL_HEIGHT (f) - x->menubar_height; | 660 | ew->core.height = FRAME_PIXEL_HEIGHT (f) - x->menubar_height; |
| 661 | ew->core.width = FRAME_PIXEL_WIDTH (f); | 661 | ew->core.width = FRAME_PIXEL_WIDTH (f); |
| 662 | ew->core.background_pixel = x->background_pixel; | 662 | ew->core.background_pixel = FRAME_BACKGROUND_PIXEL (f); |
| 663 | ew->emacs_frame.internal_border_width = f->internal_border_width; | 663 | ew->emacs_frame.internal_border_width = f->internal_border_width; |
| 664 | ew->emacs_frame.font = x->font; | 664 | ew->emacs_frame.font = x->font; |
| 665 | ew->emacs_frame.foreground_pixel = x->foreground_pixel; | 665 | ew->emacs_frame.foreground_pixel = FRAME_FOREGROUND_PIXEL (f); |
| 666 | ew->emacs_frame.cursor_color = x->cursor_pixel; | 666 | ew->emacs_frame.cursor_color = x->cursor_pixel; |
| 667 | ew->core.border_pixel = x->border_pixel; | 667 | ew->core.border_pixel = x->border_pixel; |
| 668 | } | 668 | } |
diff --git a/src/xfns.c b/src/xfns.c index a8388721dca..c37f99722c5 100644 --- a/src/xfns.c +++ b/src/xfns.c | |||
| @@ -865,8 +865,8 @@ x_set_foreground_color (f, arg, oldval) | |||
| 865 | unsigned long fg, old_fg; | 865 | unsigned long fg, old_fg; |
| 866 | 866 | ||
| 867 | fg = x_decode_color (f, arg, BLACK_PIX_DEFAULT (f)); | 867 | fg = x_decode_color (f, arg, BLACK_PIX_DEFAULT (f)); |
| 868 | old_fg = x->foreground_pixel; | 868 | old_fg = FRAME_FOREGROUND_PIXEL (f); |
| 869 | x->foreground_pixel = fg; | 869 | FRAME_FOREGROUND_PIXEL (f) = fg; |
| 870 | 870 | ||
| 871 | if (FRAME_X_WINDOW (f) != 0) | 871 | if (FRAME_X_WINDOW (f) != 0) |
| 872 | { | 872 | { |
| @@ -903,8 +903,8 @@ x_set_background_color (f, arg, oldval) | |||
| 903 | unsigned long bg; | 903 | unsigned long bg; |
| 904 | 904 | ||
| 905 | bg = x_decode_color (f, arg, WHITE_PIX_DEFAULT (f)); | 905 | bg = x_decode_color (f, arg, WHITE_PIX_DEFAULT (f)); |
| 906 | unload_color (f, x->background_pixel); | 906 | unload_color (f, FRAME_BACKGROUND_PIXEL (f)); |
| 907 | x->background_pixel = bg; | 907 | FRAME_BACKGROUND_PIXEL (f) = bg; |
| 908 | 908 | ||
| 909 | if (FRAME_X_WINDOW (f) != 0) | 909 | if (FRAME_X_WINDOW (f) != 0) |
| 910 | { | 910 | { |
| @@ -952,13 +952,13 @@ x_set_mouse_color (f, arg, oldval) | |||
| 952 | Cursor cursor, nontext_cursor, mode_cursor, hand_cursor; | 952 | Cursor cursor, nontext_cursor, mode_cursor, hand_cursor; |
| 953 | Cursor hourglass_cursor, horizontal_drag_cursor; | 953 | Cursor hourglass_cursor, horizontal_drag_cursor; |
| 954 | unsigned long pixel = x_decode_color (f, arg, BLACK_PIX_DEFAULT (f)); | 954 | unsigned long pixel = x_decode_color (f, arg, BLACK_PIX_DEFAULT (f)); |
| 955 | unsigned long mask_color = x->background_pixel; | 955 | unsigned long mask_color = FRAME_BACKGROUND_PIXEL (f); |
| 956 | 956 | ||
| 957 | /* Don't let pointers be invisible. */ | 957 | /* Don't let pointers be invisible. */ |
| 958 | if (mask_color == pixel) | 958 | if (mask_color == pixel) |
| 959 | { | 959 | { |
| 960 | x_free_colors (f, &pixel, 1); | 960 | x_free_colors (f, &pixel, 1); |
| 961 | pixel = x_copy_color (f, x->foreground_pixel); | 961 | pixel = x_copy_color (f, FRAME_FOREGROUND_PIXEL (f)); |
| 962 | } | 962 | } |
| 963 | 963 | ||
| 964 | unload_color (f, x->mouse_pixel); | 964 | unload_color (f, x->mouse_pixel); |
| @@ -1101,13 +1101,13 @@ x_set_cursor_color (f, arg, oldval) | |||
| 1101 | fore_pixel_allocated_p = 1; | 1101 | fore_pixel_allocated_p = 1; |
| 1102 | } | 1102 | } |
| 1103 | else | 1103 | else |
| 1104 | fore_pixel = x->background_pixel; | 1104 | fore_pixel = FRAME_BACKGROUND_PIXEL (f); |
| 1105 | 1105 | ||
| 1106 | pixel = x_decode_color (f, arg, BLACK_PIX_DEFAULT (f)); | 1106 | pixel = x_decode_color (f, arg, BLACK_PIX_DEFAULT (f)); |
| 1107 | pixel_allocated_p = 1; | 1107 | pixel_allocated_p = 1; |
| 1108 | 1108 | ||
| 1109 | /* Make sure that the cursor color differs from the background color. */ | 1109 | /* Make sure that the cursor color differs from the background color. */ |
| 1110 | if (pixel == x->background_pixel) | 1110 | if (pixel == FRAME_BACKGROUND_PIXEL (f)) |
| 1111 | { | 1111 | { |
| 1112 | if (pixel_allocated_p) | 1112 | if (pixel_allocated_p) |
| 1113 | { | 1113 | { |
| @@ -1123,7 +1123,7 @@ x_set_cursor_color (f, arg, oldval) | |||
| 1123 | x_free_colors (f, &fore_pixel, 1); | 1123 | x_free_colors (f, &fore_pixel, 1); |
| 1124 | fore_pixel_allocated_p = 0; | 1124 | fore_pixel_allocated_p = 0; |
| 1125 | } | 1125 | } |
| 1126 | fore_pixel = x->background_pixel; | 1126 | fore_pixel = FRAME_BACKGROUND_PIXEL (f); |
| 1127 | } | 1127 | } |
| 1128 | } | 1128 | } |
| 1129 | 1129 | ||
| @@ -2868,8 +2868,8 @@ x_make_gc (f) | |||
| 2868 | 2868 | ||
| 2869 | /* Normal video */ | 2869 | /* Normal video */ |
| 2870 | gc_values.font = FRAME_FONT (f)->fid; | 2870 | gc_values.font = FRAME_FONT (f)->fid; |
| 2871 | gc_values.foreground = f->output_data.x->foreground_pixel; | 2871 | gc_values.foreground = FRAME_FOREGROUND_PIXEL (f); |
| 2872 | gc_values.background = f->output_data.x->background_pixel; | 2872 | gc_values.background = FRAME_BACKGROUND_PIXEL (f); |
| 2873 | gc_values.line_width = 0; /* Means 1 using fast algorithm. */ | 2873 | gc_values.line_width = 0; /* Means 1 using fast algorithm. */ |
| 2874 | f->output_data.x->normal_gc | 2874 | f->output_data.x->normal_gc |
| 2875 | = XCreateGC (FRAME_X_DISPLAY (f), | 2875 | = XCreateGC (FRAME_X_DISPLAY (f), |
| @@ -2878,8 +2878,8 @@ x_make_gc (f) | |||
| 2878 | &gc_values); | 2878 | &gc_values); |
| 2879 | 2879 | ||
| 2880 | /* Reverse video style. */ | 2880 | /* Reverse video style. */ |
| 2881 | gc_values.foreground = f->output_data.x->background_pixel; | 2881 | gc_values.foreground = FRAME_BACKGROUND_PIXEL (f); |
| 2882 | gc_values.background = f->output_data.x->foreground_pixel; | 2882 | gc_values.background = FRAME_FOREGROUND_PIXEL (f); |
| 2883 | f->output_data.x->reverse_gc | 2883 | f->output_data.x->reverse_gc |
| 2884 | = XCreateGC (FRAME_X_DISPLAY (f), | 2884 | = XCreateGC (FRAME_X_DISPLAY (f), |
| 2885 | FRAME_X_WINDOW (f), | 2885 | FRAME_X_WINDOW (f), |
| @@ -2887,7 +2887,7 @@ x_make_gc (f) | |||
| 2887 | &gc_values); | 2887 | &gc_values); |
| 2888 | 2888 | ||
| 2889 | /* Cursor has cursor-color background, background-color foreground. */ | 2889 | /* Cursor has cursor-color background, background-color foreground. */ |
| 2890 | gc_values.foreground = f->output_data.x->background_pixel; | 2890 | gc_values.foreground = FRAME_BACKGROUND_PIXEL (f); |
| 2891 | gc_values.background = f->output_data.x->cursor_pixel; | 2891 | gc_values.background = f->output_data.x->cursor_pixel; |
| 2892 | gc_values.fill_style = FillOpaqueStippled; | 2892 | gc_values.fill_style = FillOpaqueStippled; |
| 2893 | gc_values.stipple | 2893 | gc_values.stipple |
| @@ -2911,8 +2911,8 @@ x_make_gc (f) | |||
| 2911 | = (XCreatePixmapFromBitmapData | 2911 | = (XCreatePixmapFromBitmapData |
| 2912 | (FRAME_X_DISPLAY (f), FRAME_X_DISPLAY_INFO (f)->root_window, | 2912 | (FRAME_X_DISPLAY (f), FRAME_X_DISPLAY_INFO (f)->root_window, |
| 2913 | gray_bits, gray_width, gray_height, | 2913 | gray_bits, gray_width, gray_height, |
| 2914 | f->output_data.x->foreground_pixel, | 2914 | FRAME_FOREGROUND_PIXEL (f), |
| 2915 | f->output_data.x->background_pixel, | 2915 | FRAME_BACKGROUND_PIXEL (f), |
| 2916 | DefaultDepth (FRAME_X_DISPLAY (f), FRAME_X_SCREEN_NUMBER (f)))); | 2916 | DefaultDepth (FRAME_X_DISPLAY (f), FRAME_X_SCREEN_NUMBER (f)))); |
| 2917 | 2917 | ||
| 2918 | UNBLOCK_INPUT; | 2918 | UNBLOCK_INPUT; |
| @@ -3116,8 +3116,8 @@ This function is an internal primitive--use `make-frame' instead. */) | |||
| 3116 | /* Function x_decode_color can signal an error. Make | 3116 | /* Function x_decode_color can signal an error. Make |
| 3117 | sure to initialize color slots so that we won't try | 3117 | sure to initialize color slots so that we won't try |
| 3118 | to free colors we haven't allocated. */ | 3118 | to free colors we haven't allocated. */ |
| 3119 | f->output_data.x->foreground_pixel = -1; | 3119 | FRAME_FOREGROUND_PIXEL (f) = -1; |
| 3120 | f->output_data.x->background_pixel = -1; | 3120 | FRAME_BACKGROUND_PIXEL (f) = -1; |
| 3121 | f->output_data.x->cursor_pixel = -1; | 3121 | f->output_data.x->cursor_pixel = -1; |
| 3122 | f->output_data.x->cursor_foreground_pixel = -1; | 3122 | f->output_data.x->cursor_foreground_pixel = -1; |
| 3123 | f->output_data.x->border_pixel = -1; | 3123 | f->output_data.x->border_pixel = -1; |
| @@ -3125,9 +3125,9 @@ This function is an internal primitive--use `make-frame' instead. */) | |||
| 3125 | 3125 | ||
| 3126 | black = build_string ("black"); | 3126 | black = build_string ("black"); |
| 3127 | GCPRO1 (black); | 3127 | GCPRO1 (black); |
| 3128 | f->output_data.x->foreground_pixel | 3128 | FRAME_FOREGROUND_PIXEL (f) |
| 3129 | = x_decode_color (f, black, BLACK_PIX_DEFAULT (f)); | 3129 | = x_decode_color (f, black, BLACK_PIX_DEFAULT (f)); |
| 3130 | f->output_data.x->background_pixel | 3130 | FRAME_BACKGROUND_PIXEL (f) |
| 3131 | = x_decode_color (f, black, BLACK_PIX_DEFAULT (f)); | 3131 | = x_decode_color (f, black, BLACK_PIX_DEFAULT (f)); |
| 3132 | f->output_data.x->cursor_pixel | 3132 | f->output_data.x->cursor_pixel |
| 3133 | = x_decode_color (f, black, BLACK_PIX_DEFAULT (f)); | 3133 | = x_decode_color (f, black, BLACK_PIX_DEFAULT (f)); |
| @@ -4698,8 +4698,8 @@ x_create_tip_frame (dpyinfo, parms, text) | |||
| 4698 | /* Function x_decode_color can signal an error. Make | 4698 | /* Function x_decode_color can signal an error. Make |
| 4699 | sure to initialize color slots so that we won't try | 4699 | sure to initialize color slots so that we won't try |
| 4700 | to free colors we haven't allocated. */ | 4700 | to free colors we haven't allocated. */ |
| 4701 | f->output_data.x->foreground_pixel = -1; | 4701 | FRAME_FOREGROUND_PIXEL (f) = -1; |
| 4702 | f->output_data.x->background_pixel = -1; | 4702 | FRAME_BACKGROUND_PIXEL (f) = -1; |
| 4703 | f->output_data.x->cursor_pixel = -1; | 4703 | f->output_data.x->cursor_pixel = -1; |
| 4704 | f->output_data.x->cursor_foreground_pixel = -1; | 4704 | f->output_data.x->cursor_foreground_pixel = -1; |
| 4705 | f->output_data.x->border_pixel = -1; | 4705 | f->output_data.x->border_pixel = -1; |
| @@ -4707,9 +4707,9 @@ x_create_tip_frame (dpyinfo, parms, text) | |||
| 4707 | 4707 | ||
| 4708 | black = build_string ("black"); | 4708 | black = build_string ("black"); |
| 4709 | GCPRO1 (black); | 4709 | GCPRO1 (black); |
| 4710 | f->output_data.x->foreground_pixel | 4710 | FRAME_FOREGROUND_PIXEL (f) |
| 4711 | = x_decode_color (f, black, BLACK_PIX_DEFAULT (f)); | 4711 | = x_decode_color (f, black, BLACK_PIX_DEFAULT (f)); |
| 4712 | f->output_data.x->background_pixel | 4712 | FRAME_BACKGROUND_PIXEL (f) |
| 4713 | = x_decode_color (f, black, BLACK_PIX_DEFAULT (f)); | 4713 | = x_decode_color (f, black, BLACK_PIX_DEFAULT (f)); |
| 4714 | f->output_data.x->cursor_pixel | 4714 | f->output_data.x->cursor_pixel |
| 4715 | = x_decode_color (f, black, BLACK_PIX_DEFAULT (f)); | 4715 | = x_decode_color (f, black, BLACK_PIX_DEFAULT (f)); |
diff --git a/src/xterm.c b/src/xterm.c index 73b2e2ae44d..35e70dc220d 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -2888,8 +2888,8 @@ XTflash (f) | |||
| 2888 | XGCValues values; | 2888 | XGCValues values; |
| 2889 | 2889 | ||
| 2890 | values.function = GXxor; | 2890 | values.function = GXxor; |
| 2891 | values.foreground = (f->output_data.x->foreground_pixel | 2891 | values.foreground = (FRAME_FOREGROUND_PIXEL (f) |
| 2892 | ^ f->output_data.x->background_pixel); | 2892 | ^ FRAME_BACKGROUND_PIXEL (f)); |
| 2893 | 2893 | ||
| 2894 | gc = XCreateGC (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), | 2894 | gc = XCreateGC (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), |
| 2895 | GCFunction | GCForeground, &values); | 2895 | GCFunction | GCForeground, &values); |
| @@ -9017,8 +9017,8 @@ x_free_frame_resources (f) | |||
| 9017 | XDestroyWindow (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f)); | 9017 | XDestroyWindow (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f)); |
| 9018 | #endif /* !USE_X_TOOLKIT */ | 9018 | #endif /* !USE_X_TOOLKIT */ |
| 9019 | 9019 | ||
| 9020 | unload_color (f, f->output_data.x->foreground_pixel); | 9020 | unload_color (f, FRAME_FOREGROUND_PIXEL (f)); |
| 9021 | unload_color (f, f->output_data.x->background_pixel); | 9021 | unload_color (f, FRAME_BACKGROUND_PIXEL (f)); |
| 9022 | unload_color (f, f->output_data.x->cursor_pixel); | 9022 | unload_color (f, f->output_data.x->cursor_pixel); |
| 9023 | unload_color (f, f->output_data.x->cursor_foreground_pixel); | 9023 | unload_color (f, f->output_data.x->cursor_foreground_pixel); |
| 9024 | unload_color (f, f->output_data.x->border_pixel); | 9024 | unload_color (f, f->output_data.x->border_pixel); |
diff --git a/src/xterm.h b/src/xterm.h index 873b7da2b14..5f37a23448c 100644 --- a/src/xterm.h +++ b/src/xterm.h | |||
| @@ -521,8 +521,10 @@ struct x_output | |||
| 521 | 521 | ||
| 522 | /* Pixel values used for various purposes. | 522 | /* Pixel values used for various purposes. |
| 523 | border_pixel may be -1 meaning use a gray tile. */ | 523 | border_pixel may be -1 meaning use a gray tile. */ |
| 524 | #if 0 /* These are also defined in struct frame. Use that instead. */ | ||
| 524 | unsigned long background_pixel; | 525 | unsigned long background_pixel; |
| 525 | unsigned long foreground_pixel; | 526 | unsigned long foreground_pixel; |
| 527 | #endif | ||
| 526 | unsigned long cursor_pixel; | 528 | unsigned long cursor_pixel; |
| 527 | unsigned long border_pixel; | 529 | unsigned long border_pixel; |
| 528 | unsigned long mouse_pixel; | 530 | unsigned long mouse_pixel; |