aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaroly Lorentey2006-04-01 16:11:29 +0000
committerKaroly Lorentey2006-04-01 16:11:29 +0000
commitce593f6e6b85e58206264cad983c796ce8dd41a2 (patch)
tree3596abcaa0164629aec976947c1507924fd0e44b
parentb97a79c4f5c17abca8cb66e52927d524c5e1ef62 (diff)
downloademacs-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
-rw-r--r--README.multi-tty25
-rw-r--r--src/widget.c4
-rw-r--r--src/xfns.c48
-rw-r--r--src/xterm.c8
-rw-r--r--src/xterm.h2
5 files changed, 56 insertions, 31 deletions
diff --git a/README.multi-tty b/README.multi-tty
index f3061c921d0..801bc577533 100644
--- a/README.multi-tty
+++ b/README.multi-tty
@@ -404,8 +404,11 @@ is probably not very interesting for anyone else.)
404THINGS TO DO 404THINGS TO DO
405------------ 405------------
406 406
407** emacsclient -t on the console does not work after su: 407** emacsclient -t on the console does not work after su. You have to
408 use non-root accounts or start as root to see this.
408 409
410 Login: root
411 Password:
409 # su lorentey 412 # su lorentey
410 $ emacsclient -t 413 $ emacsclient -t
411 *ERROR*: Could not open file: /dev/tty1 414 *ERROR*: Could not open file: /dev/tty1
@@ -415,6 +418,12 @@ THINGS TO DO
415 bring back the ugly pty proxy hack from the initial versions of 418 bring back the ugly pty proxy hack from the initial versions of
416 multi-tty. Suggestions would be appreciated. 419 multi-tty. Suggestions would be appreciated.
417 420
421 Update: we could change emacsclient to pass its open file
422 descriptor to the Emacs process. Unfortunately, this requires a
423 new Lisp-level Emacs API, and as file descriptors are not otherwise
424 exported to Lisp, this approach seems at least as ugly as the pty
425 proxy idea.
426
418** Understand how `quit_throw_to_read_char' works, and fix any bugs 427** Understand how `quit_throw_to_read_char' works, and fix any bugs
419 that come to light. 428 that come to light.
420 429
@@ -1494,5 +1503,19 @@ DIARY OF CHANGES
1494 1503
1495 (Done in patch-539.) 1504 (Done in patch-539.)
1496 1505
1506-- The borders on tooltip frames on X are messed up. More
1507 specifically, the frame's internal border (internal-border-width
1508 frame parameter) is not filled with the correct background color.
1509
1510 It seems the border contents are drawn onto by the
1511 update_single_window call in `x-show-tip'. After some debugging, I
1512 think the window's background color is not set up
1513 correctly---calling `x_clear_area' fills the specified area with
1514 black, not light yellow.
1515
1516 (Done in patch-544. A background_pixel field was defined both in
1517 struct frame and struct x_output, and Emacs got confused between
1518 them.)
1519
1497;;; arch-tag: 8da1619e-2e79-41a8-9ac9-a0485daad17d 1520;;; arch-tag: 8da1619e-2e79-41a8-9ac9-a0485daad17d
1498 1521
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;