# HG changeset patch # User Geoff Voelker # Date 934828349 0 # Node ID 64b742df49ca30bf22ae8daeee6a8359cf0d824f # Parent 65dbd144132dbd731ef8aee1fdca7421405c6dbd (x_set_frame_parameters): Set foreground and background first, and then set other parameters that might depend upon their new values. diff -r 65dbd144132d -r 64b742df49ca src/w32fns.c --- a/src/w32fns.c Mon Aug 16 15:47:41 1999 +0000 +++ b/src/w32fns.c Mon Aug 16 18:32:29 1999 +0000 @@ -694,7 +694,7 @@ /* Record in these vectors all the parms specified. */ Lisp_Object *parms; Lisp_Object *values; - int i; + int i, p; int left_no_change = 0, top_no_change = 0; int icon_left_no_change = 0, icon_top_no_change = 0; @@ -736,6 +736,29 @@ width = FRAME_WIDTH (f); height = FRAME_HEIGHT (f); + /* Process foreground_color and background_color before anything else. + They are independent of other properties, but other properties (e.g., + cursor_color) are dependent upon them. */ + for (p = 0; p < i; p++) + { + Lisp_Object prop, val; + + prop = parms[p]; + val = values[p]; + if (EQ (prop, Qforeground_color) || EQ (prop, Qbackground_color)) + { + register Lisp_Object param_index, old_value; + + param_index = Fget (prop, Qx_frame_parameter); + old_value = get_frame_param (f, prop); + store_frame_param (f, prop, val); + if (NATNUMP (param_index) + && (XFASTINT (param_index) + < sizeof (x_frame_parms)/sizeof (x_frame_parms[0]))) + (*x_frame_parms[XINT (param_index)].setter)(f, val, old_value); + } + } + /* Now process them in reverse of specified order. */ for (i--; i >= 0; i--) { @@ -756,6 +779,9 @@ icon_top = val; else if (EQ (prop, Qicon_left)) icon_left = val; + else if (EQ (prop, Qforeground_color) || EQ (prop, Qbackground_color)) + /* Processed above. */ + continue; else { register Lisp_Object param_index, old_value; diff -r 65dbd144132d -r 64b742df49ca src/xfns.c --- a/src/xfns.c Mon Aug 16 15:47:41 1999 +0000 +++ b/src/xfns.c Mon Aug 16 18:32:29 1999 +0000 @@ -834,7 +834,7 @@ /* Record in these vectors all the parms specified. */ Lisp_Object *parms; Lisp_Object *values; - int i; + int i, p; int left_no_change = 0, top_no_change = 0; int icon_left_no_change = 0, icon_top_no_change = 0; @@ -882,6 +882,29 @@ else height = FRAME_HEIGHT (f); + /* Process foreground_color and background_color before anything else. + They are independent of other properties, but other properties (e.g., + cursor_color) are dependent upon them. */ + for (p = 0; p < i; p++) + { + Lisp_Object prop, val; + + prop = parms[p]; + val = values[p]; + if (EQ (prop, Qforeground_color) || EQ (prop, Qbackground_color)) + { + register Lisp_Object param_index, old_value; + + param_index = Fget (prop, Qx_frame_parameter); + old_value = get_frame_param (f, prop); + store_frame_param (f, prop, val); + if (NATNUMP (param_index) + && (XFASTINT (param_index) + < sizeof (x_frame_parms)/sizeof (x_frame_parms[0]))) + (*x_frame_parms[XINT (param_index)].setter)(f, val, old_value); + } + } + /* Now process them in reverse of specified order. */ for (i--; i >= 0; i--) { @@ -902,6 +925,9 @@ icon_top = val; else if (EQ (prop, Qicon_left)) icon_left = val; + else if (EQ (prop, Qforeground_color) || EQ (prop, Qbackground_color)) + /* Processed above. */ + continue; else { register Lisp_Object param_index, old_value;