Commit 5bcee7ef authored by Karoly Lorentey's avatar Karoly Lorentey

Fix previous commit.

* src/frame.c (make_terminal_frame): Use FRAME_BACKGROUND_PIXEL and FRAME_FOREGROUND_PIXEL.
* src/gtkutil.c (xg_create_frame_widgets): Ditto.
* src/macfns.c (x_set_mouse_color): Ditto.
* src/macfns.c (x_make_gc): Ditto.
* src/msdos.c (ScreenVisualBell): Ditto.
* src/msdos.c (internal_terminal_init): Ditto.
* src/w32term.c (x_free_frame_resources): Ditto.
* src/xfns.c (x_window): Ditto.
* src/xterm.c (x_scroll_bar_create): Ditto.
* src/xterm.c (x_scroll_bar_set_handle): Ditto.

git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-545
parent ce593f6e
......@@ -588,11 +588,11 @@ make_terminal_frame (struct terminal *terminal)
for the black color. Other frames all inherit their pixels
from what's already in the_only_x_display. */
if ((!FRAMEP (selected_frame) || !FRAME_LIVE_P (XFRAME (selected_frame)))
&& f->output_data.x->background_pixel == 0
&& f->output_data.x->foreground_pixel == 0)
&& FRAME_BACKGROUND_PIXEL (f) == 0
&& FRAME_FOREGROUND_PIXEL (f) == 0)
{
f->output_data.x->background_pixel = FACE_TTY_DEFAULT_BG_COLOR;
f->output_data.x->foreground_pixel = FACE_TTY_DEFAULT_FG_COLOR;
FRAME_BACKGROUND_PIXEL (f) = FACE_TTY_DEFAULT_BG_COLOR;
FRAME_FOREGROUND_PIXEL (f) = FACE_TTY_DEFAULT_FG_COLOR;
}
}
else
......
......@@ -811,7 +811,7 @@ xg_create_frame_widgets (f)
/* Since GTK clears its window by filling with the background color,
we must keep X and GTK background in sync. */
xg_pix_to_gcolor (wfixed, f->output_data.x->background_pixel, &bg);
xg_pix_to_gcolor (wfixed, FRAME_BACKGROUND_PIXEL (f), &bg);
gtk_widget_modify_bg (wfixed, GTK_STATE_NORMAL, &bg);
/* Also, do not let any background pixmap to be set, this looks very
......
......@@ -1363,11 +1363,11 @@ x_set_mouse_color (f, arg, oldval)
Cursor cursor, nontext_cursor, mode_cursor, hand_cursor;
Cursor hourglass_cursor, horizontal_drag_cursor;
unsigned long pixel = x_decode_color (f, arg, BLACK_PIX_DEFAULT (f));
unsigned long mask_color = x->background_pixel;
unsigned long mask_color = FRAME_BACKGROUND_PIXEL (f);
/* Don't let pointers be invisible. */
if (mask_color == pixel)
pixel = x->foreground_pixel;
pixel = FRAME_FOREGROUND_PIXEL (f);
f->output_data.mac->mouse_pixel = pixel;
......@@ -2269,8 +2269,8 @@ x_make_gc (f)
= (XCreatePixmapFromBitmapData
(FRAME_X_DISPLAY (f), FRAME_X_DISPLAY_INFO (f)->root_window,
gray_bits, gray_width, gray_height,
f->output_data.x->foreground_pixel,
f->output_data.x->background_pixel,
FRAME_FOREGROUND_PIXEL (f),
FRAME_BACKGROUND_PIXEL (f),
DefaultDepth (FRAME_X_DISPLAY (f), FRAME_X_SCREEN_NUMBER (f))));
#endif
......
......@@ -508,8 +508,8 @@ ScreenVisualBell (void)
{
/* This creates an xor-mask that will swap the default fore- and
background colors. */
do_visible_bell (((the_only_x_display.foreground_pixel
^ the_only_x_display.background_pixel)
do_visible_bell (((FRAME_FOREGROUND_PIXEL (SELECTED_FRAME ())
^ FRAME_BACKGROUND_PIXEL (SELECTED_FRAME ()))
* 0x11) & 0x7f);
}
#endif
......@@ -2531,8 +2531,8 @@ internal_terminal_init ()
initial_screen_colors[0] = initial_screen_colors[1] = -1;
bzero (&the_only_x_display, sizeof the_only_x_display);
the_only_x_display.background_pixel = 7; /* White */
the_only_x_display.foreground_pixel = 0; /* Black */
FRAME_BACKGROUND_PIXEL (SELECTED_FRAME ()) = 7; /* White */
FRAME_FOREGROUND_PIXEL (SELECTED_FRAME ()) = 0; /* Black */
bright_bg ();
colors = getenv ("EMACSCOLORS");
if (colors && strlen (colors) >= 2)
......@@ -2543,13 +2543,13 @@ internal_terminal_init ()
else if (isxdigit (colors[0]))
colors[0] -= (isupper (colors[0]) ? 'A' : 'a') - 10;
if (colors[0] >= 0 && colors[0] < 16)
the_only_x_display.foreground_pixel = colors[0];
FRAME_FOREGROUND_PIXEL (SELECTED_FRAME ()) = colors[0];
if (isdigit (colors[1]))
colors[1] -= '0';
else if (isxdigit (colors[1]))
colors[1] -= (isupper (colors[1]) ? 'A' : 'a') - 10;
if (colors[1] >= 0 && colors[1] < 16)
the_only_x_display.background_pixel = colors[1];
FRAME_BACKGROUND_PIXEL (SELECTED_FRAME ()) = colors[1];
}
the_only_x_display.font = (XFontStruct *)1; /* must *not* be zero */
the_only_x_display.display_info.mouse_face_mouse_frame = NULL;
......
......@@ -5828,8 +5828,8 @@ x_free_frame_resources (f)
free_frame_menubar (f);
unload_color (f, f->output_data.x->foreground_pixel);
unload_color (f, f->output_data.x->background_pixel);
unload_color (f, FRAME_FOREGROUND_PIXEL (f));
unload_color (f, FRAME_BACKGROUND_PIXEL (f));
unload_color (f, f->output_data.w32->cursor_pixel);
unload_color (f, f->output_data.w32->cursor_foreground_pixel);
unload_color (f, f->output_data.w32->border_pixel);
......
......@@ -2680,7 +2680,7 @@ x_window (f)
XSetWindowAttributes attributes;
unsigned long attribute_mask;
attributes.background_pixel = f->output_data.x->background_pixel;
attributes.background_pixel = FRAME_BACKGROUND_PIXEL (f);
attributes.border_pixel = f->output_data.x->border_pixel;
attributes.bit_gravity = StaticGravity;
attributes.backing_store = NotUseful;
......
......@@ -4732,7 +4732,7 @@ x_scroll_bar_create (w, top, left, width, height)
a.background_pixel = f->output_data.x->scroll_bar_background_pixel;
if (a.background_pixel == -1)
a.background_pixel = f->output_data.x->background_pixel;
a.background_pixel = FRAME_BACKGROUND_PIXEL (f);
a.event_mask = (ButtonPressMask | ButtonReleaseMask
| ButtonMotionMask | PointerMotionHintMask
......@@ -4906,7 +4906,7 @@ x_scroll_bar_set_handle (bar, start, end, rebuild)
/* Restore the foreground color of the GC if we changed it above. */
if (f->output_data.x->scroll_bar_foreground_pixel != -1)
XSetForeground (FRAME_X_DISPLAY (f), gc,
f->output_data.x->foreground_pixel);
FRAME_FOREGROUND_PIXEL (f));
/* Draw the empty space below the handle. Note that we can't
clear zero-height areas; that means "clear to end of window." */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment