aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJim Blandy1993-03-21 05:11:23 +0000
committerJim Blandy1993-03-21 05:11:23 +0000
commit49795535f124fc0033a856b1d72c8262de1b3a1c (patch)
tree98824016aa48c6bedc4e6008543663ee628054c4
parent7bbbf29af065a8e86021744f44b4f2c774b71e43 (diff)
downloademacs-49795535f124fc0033a856b1d72c8262de1b3a1c.tar.gz
emacs-49795535f124fc0033a856b1d72c8262de1b3a1c.zip
Use the `visiblity' parameter to determine the initial state of
the frame, instead of the `iconic-startup' and `suppress-initial-map'. * xfns.c (x_icon): Test the Qvisibility parameter against Qicon, instead of the Qiconic_startup against Qt. (x_create_frame): Test Qvisibility against Qnil and Qicon, instead of testing Qsuppress_initial_map and Qvisibility. (Qicon): New symbol. (Qiconic_startup, Qsuppress_icon, Qsuppress_initial_map): Removed. (syms_of_xfns): Adjusted appropriately. * xfns.c [not HAVE_X11] (x_create_frame): Check Qicon_type, instead of Qsuppress_icon. * xfns.c (x_set_visibility): Instead of interpreting only Qt as `make the frame visible' and everything else as `iconify the frame', interpret Qicon as `iconify the frame' and everything else as `make the frame visible.' * xfns.c (x_get_arg): When the type of the resource is `symbol', return `true' and `on' as Qt, and `false' and `off' as Qnil.
-rw-r--r--src/xfns.c97
1 files changed, 55 insertions, 42 deletions
diff --git a/src/xfns.c b/src/xfns.c
index 8d411508dcd..9fa8a052cb5 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -161,23 +161,21 @@ Lisp_Object Qcursor_type;
161Lisp_Object Qfont; 161Lisp_Object Qfont;
162Lisp_Object Qforeground_color; 162Lisp_Object Qforeground_color;
163Lisp_Object Qgeometry; 163Lisp_Object Qgeometry;
164Lisp_Object Qicon;
164Lisp_Object Qicon_left; 165Lisp_Object Qicon_left;
165Lisp_Object Qicon_top; 166Lisp_Object Qicon_top;
166Lisp_Object Qicon_type; 167Lisp_Object Qicon_type;
167Lisp_Object Qiconic_startup;
168Lisp_Object Qinternal_border_width; 168Lisp_Object Qinternal_border_width;
169Lisp_Object Qleft; 169Lisp_Object Qleft;
170Lisp_Object Qmouse_color; 170Lisp_Object Qmouse_color;
171Lisp_Object Qnone; 171Lisp_Object Qnone;
172Lisp_Object Qparent_id; 172Lisp_Object Qparent_id;
173Lisp_Object Qsuppress_icon;
174Lisp_Object Qsuppress_initial_map;
175Lisp_Object Qtop; 173Lisp_Object Qtop;
176Lisp_Object Qundefined_color; 174Lisp_Object Qundefined_color;
177Lisp_Object Qvertical_scroll_bars; 175Lisp_Object Qvertical_scroll_bars;
176Lisp_Object Qvisibility;
178Lisp_Object Qwindow_id; 177Lisp_Object Qwindow_id;
179Lisp_Object Qx_frame_parameter; 178Lisp_Object Qx_frame_parameter;
180Lisp_Object Qvisibility;
181 179
182/* The below are defined in frame.c. */ 180/* The below are defined in frame.c. */
183extern Lisp_Object Qheight, Qminibuffer, Qname, Qonly, Qwidth; 181extern Lisp_Object Qheight, Qminibuffer, Qname, Qonly, Qwidth;
@@ -857,10 +855,10 @@ x_set_visibility (f, value, oldval)
857 855
858 if (NILP (value)) 856 if (NILP (value))
859 Fmake_frame_invisible (frame); 857 Fmake_frame_invisible (frame);
860 else if (EQ (value, Qt)) 858 else if (EQ (value, Qicon))
861 Fmake_frame_visible (frame);
862 else
863 Ficonify_frame (frame); 859 Ficonify_frame (frame);
860 else
861 Fmake_frame_visible (frame);
864} 862}
865 863
866static void 864static void
@@ -1429,7 +1427,19 @@ x_get_arg (alist, param, attribute, class, type)
1429 return tem; 1427 return tem;
1430 1428
1431 case symbol: 1429 case symbol:
1432 return intern (tem); 1430 /* As a special case, we map the values `true' and `on'
1431 to Qt, and `false' and `off' to Qnil. */
1432 {
1433 Lisp_Object lower = Fdowncase (tem);
1434 if (!strcmp (XSTRING (tem)->data, "on")
1435 || !strcmp (XSTRING (tem)->data, "true"))
1436 return Qt;
1437 else (!strcmp (XSTRING (tem)->data, "off")
1438 || !strcmp (XSTRING (tem)->data, "false"))
1439 return Qnil;
1440 else
1441 return intern (tem);
1442 }
1433 1443
1434 default: 1444 default:
1435 abort (); 1445 abort ();
@@ -1703,12 +1713,10 @@ x_icon (f, parms)
1703 x_wm_set_icon_position (f, XINT (icon_x), XINT (icon_y)); 1713 x_wm_set_icon_position (f, XINT (icon_x), XINT (icon_y));
1704 1714
1705 /* Start up iconic or window? */ 1715 /* Start up iconic or window? */
1706 x_wm_set_window_state (f, 1716 x_wm_set_window_state
1707 (EQ (x_get_arg (parms, Qiconic_startup, 1717 (f, (EQ (x_get_arg (parms, Qvisibility, 0, 0, symbol), Qicon)
1708 0, 0, boolean), 1718 ? IconicState
1709 Qt) 1719 : NormalState));
1710 ? IconicState
1711 : NormalState));
1712 1720
1713 UNBLOCK_INPUT; 1721 UNBLOCK_INPUT;
1714} 1722}
@@ -1911,16 +1919,20 @@ be shared by the new frame.")
1911 1919
1912 /* Make the window appear on the frame and enable display, 1920 /* Make the window appear on the frame and enable display,
1913 unless the caller says not to. */ 1921 unless the caller says not to. */
1914 if (!EQ (x_get_arg (parms, Qsuppress_initial_map, 0, 0, boolean), Qt)) 1922 {
1915 { 1923 Lisp_Object visibility = x_get_arg (parms, Qvisibility, 0, 0, symbol);
1916 tem = x_get_arg (parms, Qvisibility, 0, 0, boolean); 1924
1917 if (EQ (tem, Qicon)) 1925 if (EQ (visibility, Qunbound))
1918 x_iconify_frame (f); 1926 visibility = Qt;
1919 /* Note that the default is Qunbound, 1927
1920 so by default we do make visible. */ 1928 if (EQ (visibility, Qicon))
1921 else if (!EQ (tem, Qnil)) 1929 x_iconify_frame (f);
1922 x_make_frame_visible (f); 1930 else if (! NILP (visibility))
1923 } 1931 x_make_frame_visible (f);
1932 else
1933 /* Must have been Qnil. */
1934 ;
1935 }
1924 1936
1925 return frame; 1937 return frame;
1926#else /* X10 */ 1938#else /* X10 */
@@ -2122,14 +2134,11 @@ be shared by the new frame.")
2122 tem = x_get_arg (parms, Qunsplittable, 0, 0, boolean); 2134 tem = x_get_arg (parms, Qunsplittable, 0, 0, boolean);
2123 f->no_split = minibuffer_only || EQ (tem, Qt); 2135 f->no_split = minibuffer_only || EQ (tem, Qt);
2124 2136
2125 /* Do not create an icon window if the caller says not to */ 2137 /* Do not create an icon window if the caller says not to.
2126 if (!EQ (x_get_arg (parms, Qsuppress_icon, 0, 0, boolean), Qt) 2138 I'm not sure that this code is right; how does X10 handle icons? */
2127 || f->display.x->parent_desc != ROOT_WINDOW) 2139 x_text_icon (f, iconidentity);
2128 { 2140 x_default_parameter (f, parms, Qicon_type, Qnil,
2129 x_text_icon (f, iconidentity); 2141 "BitmapIcon", 0, symbol);
2130 x_default_parameter (f, parms, Qicon_type, Qnil,
2131 "BitmapIcon", 0, symbol);
2132 }
2133 2142
2134 /* Tell the X server the previously set values of the 2143 /* Tell the X server the previously set values of the
2135 background, border and mouse colors; also create the mouse cursor. */ 2144 background, border and mouse colors; also create the mouse cursor. */
@@ -2147,9 +2156,17 @@ be shared by the new frame.")
2147 Fmodify_frame_parameters (frame, parms); 2156 Fmodify_frame_parameters (frame, parms);
2148 2157
2149 /* Make the window appear on the frame and enable display. */ 2158 /* Make the window appear on the frame and enable display. */
2159 {
2160 Lisp_Object visibility = x_get_arg (parms, Qvisibility, 0, 0, symbol);
2161
2162 if (EQ (visibility, Qunbound))
2163 visibility = Qt;
2164
2165 if (! EQ (visibility, Qicon)
2166 && ! NILP (visibility))
2167 x_make_window_visible (f);
2168 }
2150 2169
2151 if (!EQ (x_get_arg (parms, Qsuppress_initial_map, 0, 0, boolean), Qt))
2152 x_make_window_visible (f);
2153 SET_FRAME_GARBAGED (f); 2170 SET_FRAME_GARBAGED (f);
2154 2171
2155 return frame; 2172 return frame;
@@ -3861,14 +3878,14 @@ syms_of_xfns ()
3861 staticpro (&Qforeground_color); 3878 staticpro (&Qforeground_color);
3862 Qgeometry = intern ("geometry"); 3879 Qgeometry = intern ("geometry");
3863 staticpro (&Qgeometry); 3880 staticpro (&Qgeometry);
3881 Qicon = intern ("icon");
3882 staticpro (&Qicon);
3864 Qicon_left = intern ("icon-left"); 3883 Qicon_left = intern ("icon-left");
3865 staticpro (&Qicon_left); 3884 staticpro (&Qicon_left);
3866 Qicon_top = intern ("icon-top"); 3885 Qicon_top = intern ("icon-top");
3867 staticpro (&Qicon_top); 3886 staticpro (&Qicon_top);
3868 Qicon_type = intern ("icon-type"); 3887 Qicon_type = intern ("icon-type");
3869 staticpro (&Qicon_type); 3888 staticpro (&Qicon_type);
3870 Qiconic_startup = intern ("iconic-startup");
3871 staticpro (&Qiconic_startup);
3872 Qinternal_border_width = intern ("internal-border-width"); 3889 Qinternal_border_width = intern ("internal-border-width");
3873 staticpro (&Qinternal_border_width); 3890 staticpro (&Qinternal_border_width);
3874 Qleft = intern ("left"); 3891 Qleft = intern ("left");
@@ -3879,23 +3896,19 @@ syms_of_xfns ()
3879 staticpro (&Qnone); 3896 staticpro (&Qnone);
3880 Qparent_id = intern ("parent-id"); 3897 Qparent_id = intern ("parent-id");
3881 staticpro (&Qparent_id); 3898 staticpro (&Qparent_id);
3882 Qsuppress_icon = intern ("suppress-icon");
3883 staticpro (&Qsuppress_icon);
3884 Qsuppress_initial_map = intern ("suppress-initial-map");
3885 staticpro (&Qsuppress_initial_map);
3886 Qtop = intern ("top"); 3899 Qtop = intern ("top");
3887 staticpro (&Qtop); 3900 staticpro (&Qtop);
3888 Qundefined_color = intern ("undefined-color"); 3901 Qundefined_color = intern ("undefined-color");
3889 staticpro (&Qundefined_color); 3902 staticpro (&Qundefined_color);
3890 Qvertical_scroll_bars = intern ("vertical-scroll-bars"); 3903 Qvertical_scroll_bars = intern ("vertical-scroll-bars");
3891 staticpro (&Qvertical_scroll_bars); 3904 staticpro (&Qvertical_scroll_bars);
3905 Qvisibility = intern ("visibility");
3906 staticpro (&Qvisibility);
3892 Qwindow_id = intern ("window-id"); 3907 Qwindow_id = intern ("window-id");
3893 staticpro (&Qwindow_id); 3908 staticpro (&Qwindow_id);
3894 Qx_frame_parameter = intern ("x-frame-parameter"); 3909 Qx_frame_parameter = intern ("x-frame-parameter");
3895 staticpro (&Qx_frame_parameter); 3910 staticpro (&Qx_frame_parameter);
3896 /* This is the end of symbol initialization. */ 3911 /* This is the end of symbol initialization. */
3897 Qvisibility = intern ("visibility");
3898 staticpro (&Qvisibility);
3899 3912
3900 Fput (Qundefined_color, Qerror_conditions, 3913 Fput (Qundefined_color, Qerror_conditions,
3901 Fcons (Qundefined_color, Fcons (Qerror, Qnil))); 3914 Fcons (Qundefined_color, Fcons (Qerror, Qnil)));