diff options
| author | Geoff Voelker | 1999-08-16 18:32:29 +0000 |
|---|---|---|
| committer | Geoff Voelker | 1999-08-16 18:32:29 +0000 |
| commit | a797a73ddce55098a21ae9e141dd0a3b8109cb94 (patch) | |
| tree | 8212dd0d0ae5782279c4b977d5063d430f0e77cf /src | |
| parent | 2fe8522765569482df86c8b21547f51563bb299a (diff) | |
| download | emacs-a797a73ddce55098a21ae9e141dd0a3b8109cb94.tar.gz emacs-a797a73ddce55098a21ae9e141dd0a3b8109cb94.zip | |
(x_set_frame_parameters): Set foreground and
background first, and then set other parameters that might
depend upon their new values.
Diffstat (limited to 'src')
| -rw-r--r-- | src/w32fns.c | 28 | ||||
| -rw-r--r-- | src/xfns.c | 28 |
2 files changed, 54 insertions, 2 deletions
diff --git a/src/w32fns.c b/src/w32fns.c index f4c039f7d4e..79574f5b82a 100644 --- a/src/w32fns.c +++ b/src/w32fns.c | |||
| @@ -694,7 +694,7 @@ x_set_frame_parameters (f, alist) | |||
| 694 | /* Record in these vectors all the parms specified. */ | 694 | /* Record in these vectors all the parms specified. */ |
| 695 | Lisp_Object *parms; | 695 | Lisp_Object *parms; |
| 696 | Lisp_Object *values; | 696 | Lisp_Object *values; |
| 697 | int i; | 697 | int i, p; |
| 698 | int left_no_change = 0, top_no_change = 0; | 698 | int left_no_change = 0, top_no_change = 0; |
| 699 | int icon_left_no_change = 0, icon_top_no_change = 0; | 699 | int icon_left_no_change = 0, icon_top_no_change = 0; |
| 700 | 700 | ||
| @@ -736,6 +736,29 @@ x_set_frame_parameters (f, alist) | |||
| 736 | width = FRAME_WIDTH (f); | 736 | width = FRAME_WIDTH (f); |
| 737 | height = FRAME_HEIGHT (f); | 737 | height = FRAME_HEIGHT (f); |
| 738 | 738 | ||
| 739 | /* Process foreground_color and background_color before anything else. | ||
| 740 | They are independent of other properties, but other properties (e.g., | ||
| 741 | cursor_color) are dependent upon them. */ | ||
| 742 | for (p = 0; p < i; p++) | ||
| 743 | { | ||
| 744 | Lisp_Object prop, val; | ||
| 745 | |||
| 746 | prop = parms[p]; | ||
| 747 | val = values[p]; | ||
| 748 | if (EQ (prop, Qforeground_color) || EQ (prop, Qbackground_color)) | ||
| 749 | { | ||
| 750 | register Lisp_Object param_index, old_value; | ||
| 751 | |||
| 752 | param_index = Fget (prop, Qx_frame_parameter); | ||
| 753 | old_value = get_frame_param (f, prop); | ||
| 754 | store_frame_param (f, prop, val); | ||
| 755 | if (NATNUMP (param_index) | ||
| 756 | && (XFASTINT (param_index) | ||
| 757 | < sizeof (x_frame_parms)/sizeof (x_frame_parms[0]))) | ||
| 758 | (*x_frame_parms[XINT (param_index)].setter)(f, val, old_value); | ||
| 759 | } | ||
| 760 | } | ||
| 761 | |||
| 739 | /* Now process them in reverse of specified order. */ | 762 | /* Now process them in reverse of specified order. */ |
| 740 | for (i--; i >= 0; i--) | 763 | for (i--; i >= 0; i--) |
| 741 | { | 764 | { |
| @@ -756,6 +779,9 @@ x_set_frame_parameters (f, alist) | |||
| 756 | icon_top = val; | 779 | icon_top = val; |
| 757 | else if (EQ (prop, Qicon_left)) | 780 | else if (EQ (prop, Qicon_left)) |
| 758 | icon_left = val; | 781 | icon_left = val; |
| 782 | else if (EQ (prop, Qforeground_color) || EQ (prop, Qbackground_color)) | ||
| 783 | /* Processed above. */ | ||
| 784 | continue; | ||
| 759 | else | 785 | else |
| 760 | { | 786 | { |
| 761 | register Lisp_Object param_index, old_value; | 787 | register Lisp_Object param_index, old_value; |
diff --git a/src/xfns.c b/src/xfns.c index 81e4cece27f..5a1b201f0e6 100644 --- a/src/xfns.c +++ b/src/xfns.c | |||
| @@ -834,7 +834,7 @@ x_set_frame_parameters (f, alist) | |||
| 834 | /* Record in these vectors all the parms specified. */ | 834 | /* Record in these vectors all the parms specified. */ |
| 835 | Lisp_Object *parms; | 835 | Lisp_Object *parms; |
| 836 | Lisp_Object *values; | 836 | Lisp_Object *values; |
| 837 | int i; | 837 | int i, p; |
| 838 | int left_no_change = 0, top_no_change = 0; | 838 | int left_no_change = 0, top_no_change = 0; |
| 839 | int icon_left_no_change = 0, icon_top_no_change = 0; | 839 | int icon_left_no_change = 0, icon_top_no_change = 0; |
| 840 | 840 | ||
| @@ -882,6 +882,29 @@ x_set_frame_parameters (f, alist) | |||
| 882 | else | 882 | else |
| 883 | height = FRAME_HEIGHT (f); | 883 | height = FRAME_HEIGHT (f); |
| 884 | 884 | ||
| 885 | /* Process foreground_color and background_color before anything else. | ||
| 886 | They are independent of other properties, but other properties (e.g., | ||
| 887 | cursor_color) are dependent upon them. */ | ||
| 888 | for (p = 0; p < i; p++) | ||
| 889 | { | ||
| 890 | Lisp_Object prop, val; | ||
| 891 | |||
| 892 | prop = parms[p]; | ||
| 893 | val = values[p]; | ||
| 894 | if (EQ (prop, Qforeground_color) || EQ (prop, Qbackground_color)) | ||
| 895 | { | ||
| 896 | register Lisp_Object param_index, old_value; | ||
| 897 | |||
| 898 | param_index = Fget (prop, Qx_frame_parameter); | ||
| 899 | old_value = get_frame_param (f, prop); | ||
| 900 | store_frame_param (f, prop, val); | ||
| 901 | if (NATNUMP (param_index) | ||
| 902 | && (XFASTINT (param_index) | ||
| 903 | < sizeof (x_frame_parms)/sizeof (x_frame_parms[0]))) | ||
| 904 | (*x_frame_parms[XINT (param_index)].setter)(f, val, old_value); | ||
| 905 | } | ||
| 906 | } | ||
| 907 | |||
| 885 | /* Now process them in reverse of specified order. */ | 908 | /* Now process them in reverse of specified order. */ |
| 886 | for (i--; i >= 0; i--) | 909 | for (i--; i >= 0; i--) |
| 887 | { | 910 | { |
| @@ -902,6 +925,9 @@ x_set_frame_parameters (f, alist) | |||
| 902 | icon_top = val; | 925 | icon_top = val; |
| 903 | else if (EQ (prop, Qicon_left)) | 926 | else if (EQ (prop, Qicon_left)) |
| 904 | icon_left = val; | 927 | icon_left = val; |
| 928 | else if (EQ (prop, Qforeground_color) || EQ (prop, Qbackground_color)) | ||
| 929 | /* Processed above. */ | ||
| 930 | continue; | ||
| 905 | else | 931 | else |
| 906 | { | 932 | { |
| 907 | register Lisp_Object param_index, old_value; | 933 | register Lisp_Object param_index, old_value; |