changeset 25289:64b742df49ca

(x_set_frame_parameters): Set foreground and background first, and then set other parameters that might depend upon their new values.
author Geoff Voelker <voelker@cs.washington.edu>
date Mon, 16 Aug 1999 18:32:29 +0000
parents 65dbd144132d
children a80acb2a8273
files src/w32fns.c src/xfns.c
diffstat 2 files changed, 54 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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;
--- 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;