diff options
| author | Jim Blandy | 1992-08-19 06:46:08 +0000 |
|---|---|---|
| committer | Jim Blandy | 1992-08-19 06:46:08 +0000 |
| commit | f945b92083818d97c1c934d558ede679baafa564 (patch) | |
| tree | 424e641dca8ab20a6b15a1dd9448a1e88a90379a /src | |
| parent | 11e82b76f2744c54e824e3a08bbae7c3746fc888 (diff) | |
| download | emacs-f945b92083818d97c1c934d558ede679baafa564.tar.gz emacs-f945b92083818d97c1c934d558ede679baafa564.zip | |
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
OLDVAL.
(x_explicitly_set_name, x_implicitly_set_name): New functions.
(x_frame_parms): Use x_explicitly_set_name here.
(x_window): Use x_implicitly_set_name here.
* xfns.c (Fx_create_frame): Initialize f->display.x->wm_hints here.
* xfns.c (x_set_name): Call x_set_text_property with a Lisp_Object
string as an argument, rather than a pointer and a length.
* xfns.c (x_get_arg): Accept a new type - symbol. If we've
retrieved a string from the xrdb database and the user wants a
symbol, intern it.
(Fx_create_frame): Use the symbol type here.
* xfns.c (x_figure_window_size, x_icon, Fx_create_frame): Use
values from enum resource_types for the last arg to x_get_arg,
instead of passing numbers.
* xfns.c (Fx_create_frame): When setting up the scroll bars, use
the type parameter to x_default_parameter, rather than prefixing
the resource name with a question mark.
* xfns.c [not HAVE_X11] (Fx_create_frame): The resource which
determines whether or not to use a bitmapped icon is called
"IconType", not "BitmapIcon". Update this.
* xfns.c (x_set_name): Used x_set_text_property instead of XSetWMName and
XSetWMIconName.
* xfns.c (select_visual): Fetch the visual id directly from v;
don't call XVisualIDFromVisual, since that function is not
available in earlier versions of X.
* xfns.c (x_make_gc): cursor_bits can't be local to the function;
it's static.
* xfns.c (Fx_create_frame): Make the default for the icon-type
parameter nil, not t. It seems to cause problems with some X
servers.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xfns.c | 200 |
1 files changed, 131 insertions, 69 deletions
diff --git a/src/xfns.c b/src/xfns.c index 8e88655998a..bedb229336f 100644 --- a/src/xfns.c +++ b/src/xfns.c | |||
| @@ -403,7 +403,7 @@ void x_set_icon_type (); | |||
| 403 | void x_set_font (); | 403 | void x_set_font (); |
| 404 | void x_set_border_width (); | 404 | void x_set_border_width (); |
| 405 | void x_set_internal_border_width (); | 405 | void x_set_internal_border_width (); |
| 406 | void x_set_name (); | 406 | void x_explicitly_set_name (); |
| 407 | void x_set_autoraise (); | 407 | void x_set_autoraise (); |
| 408 | void x_set_autolower (); | 408 | void x_set_autolower (); |
| 409 | void x_set_vertical_scrollbar (); | 409 | void x_set_vertical_scrollbar (); |
| @@ -420,7 +420,7 @@ static struct x_frame_parm_table x_frame_parms[] = | |||
| 420 | "font", x_set_font, | 420 | "font", x_set_font, |
| 421 | "border-width", x_set_border_width, | 421 | "border-width", x_set_border_width, |
| 422 | "internal-border-width", x_set_internal_border_width, | 422 | "internal-border-width", x_set_internal_border_width, |
| 423 | "name", x_set_name, | 423 | "name", x_explicitly_set_name, |
| 424 | "autoraise", x_set_autoraise, | 424 | "autoraise", x_set_autoraise, |
| 425 | "autolower", x_set_autolower, | 425 | "autolower", x_set_autolower, |
| 426 | "vertical-scrollbar", x_set_vertical_scrollbar, | 426 | "vertical-scrollbar", x_set_vertical_scrollbar, |
| @@ -1164,44 +1164,83 @@ x_set_internal_border_width (f, arg, oldval) | |||
| 1164 | } | 1164 | } |
| 1165 | } | 1165 | } |
| 1166 | 1166 | ||
| 1167 | void | 1167 | void x_user_set_name (f, arg, oldval) |
| 1168 | x_set_name (f, arg, oldval) | ||
| 1169 | struct frame *f; | 1168 | struct frame *f; |
| 1170 | Lisp_Object arg, oldval; | 1169 | Lisp_Object arg, oldval; |
| 1171 | { | 1170 | { |
| 1172 | /* If ARG is nil, set the name to the x_id_name. */ | 1171 | } |
| 1173 | if (NILP (arg)) | 1172 | |
| 1174 | arg = build_string (x_id_name); | 1173 | /* Change the name of frame F to ARG. If ARG is nil, set F's name to |
| 1174 | x_id_name. | ||
| 1175 | |||
| 1176 | If EXPLICIT is non-zero, that indicates that lisp code is setting the | ||
| 1177 | name; if ARG is a string, set F's name to ARG and set | ||
| 1178 | F->explicit_name; if ARG is Qnil, then clear F->explicit_name. | ||
| 1179 | |||
| 1180 | If EXPLICIT is zero, that indicates that Emacs redisplay code is | ||
| 1181 | suggesting a new name, which lisp code should override; if | ||
| 1182 | F->explicit_name is set, ignore the new name; otherwise, set it. */ | ||
| 1183 | |||
| 1184 | void | ||
| 1185 | x_set_name (f, name, explicit) | ||
| 1186 | struct frame *f; | ||
| 1187 | Lisp_Object name; | ||
| 1188 | int explicit; | ||
| 1189 | { | ||
| 1190 | /* Make sure that requests from lisp code override requests from | ||
| 1191 | Emacs redisplay code. */ | ||
| 1192 | if (explicit) | ||
| 1193 | { | ||
| 1194 | /* If we're switching from explicit to implicit, we had better | ||
| 1195 | update the mode lines and thereby update the title. */ | ||
| 1196 | if (f->explicit_name && NILP (name)) | ||
| 1197 | update_mode_lines; | ||
| 1198 | |||
| 1199 | f->explicit_name = ! NILP (name); | ||
| 1200 | } | ||
| 1201 | else if (f->explicit_name) | ||
| 1202 | return; | ||
| 1203 | |||
| 1204 | /* If NAME is nil, set the name to the x_id_name. */ | ||
| 1205 | if (NILP (name)) | ||
| 1206 | name = build_string (x_id_name); | ||
| 1175 | else | 1207 | else |
| 1176 | CHECK_STRING (arg, 0); | 1208 | CHECK_STRING (name, 0); |
| 1177 | 1209 | ||
| 1178 | /* Don't change the name if it's already ARG. */ | 1210 | /* Don't change the name if it's already NAME. */ |
| 1179 | if (! NILP (Fstring_equal (arg, f->name))) | 1211 | if (! NILP (Fstring_equal (name, f->name))) |
| 1180 | return; | 1212 | return; |
| 1181 | 1213 | ||
| 1182 | if (f->display.x->window_desc) | 1214 | if (f->display.x->window_desc) |
| 1183 | { | 1215 | { |
| 1184 | #ifdef HAVE_X11 | ||
| 1185 | XTextProperty prop; | ||
| 1186 | prop.value = XSTRING (arg)->data; | ||
| 1187 | prop.encoding = XA_STRING; | ||
| 1188 | prop.format = 8; | ||
| 1189 | prop.nitems = XSTRING (arg)->size; | ||
| 1190 | BLOCK_INPUT; | ||
| 1191 | XSetWMName (XDISPLAY f->display.x->window_desc, &prop); | ||
| 1192 | XSetWMIconName (XDISPLAY f->display.x->window_desc, &prop); | ||
| 1193 | UNBLOCK_INPUT; | ||
| 1194 | #else | ||
| 1195 | BLOCK_INPUT; | 1216 | BLOCK_INPUT; |
| 1196 | XStoreName (XDISPLAY f->display.x->window_desc, | 1217 | x_set_text_property (f, XA_WM_NAME, name); |
| 1197 | (char *) XSTRING (arg)->data); | 1218 | x_set_text_property (f, XA_WM_ICON_NAME, name); |
| 1198 | XSetIconName (XDISPLAY f->display.x->window_desc, | ||
| 1199 | (char *) XSTRING (arg)->data); | ||
| 1200 | UNBLOCK_INPUT; | 1219 | UNBLOCK_INPUT; |
| 1201 | #endif | ||
| 1202 | } | 1220 | } |
| 1203 | 1221 | ||
| 1204 | f->name = arg; | 1222 | f->name = name; |
| 1223 | } | ||
| 1224 | |||
| 1225 | /* This function should be called when the user's lisp code has | ||
| 1226 | specified a name for the frame; the name will override any set by the | ||
| 1227 | redisplay code. */ | ||
| 1228 | void | ||
| 1229 | x_explicitly_set_name (f, arg, oldval) | ||
| 1230 | FRAME_PTR f; | ||
| 1231 | Lisp_Object arg, oldval; | ||
| 1232 | { | ||
| 1233 | x_set_name (f, arg, 1); | ||
| 1234 | } | ||
| 1235 | |||
| 1236 | /* This function should be called by Emacs redisplay code to set the | ||
| 1237 | name; names set this way will never override names set by the user's | ||
| 1238 | lisp code. */ | ||
| 1239 | x_implicitly_set_name (f, arg, oldval) | ||
| 1240 | FRAME_PTR f; | ||
| 1241 | Lisp_Object arg, oldval; | ||
| 1242 | { | ||
| 1243 | x_set_name (f, arg, 0); | ||
| 1205 | } | 1244 | } |
| 1206 | 1245 | ||
| 1207 | void | 1246 | void |
| @@ -1549,7 +1588,7 @@ The defaults are specified in the file `~/.Xdefaults'.") | |||
| 1549 | /* Types we might convert a resource string into. */ | 1588 | /* Types we might convert a resource string into. */ |
| 1550 | enum resource_types | 1589 | enum resource_types |
| 1551 | { | 1590 | { |
| 1552 | number, boolean, string, | 1591 | number, boolean, string, symbol, |
| 1553 | }; | 1592 | }; |
| 1554 | 1593 | ||
| 1555 | /* Return the value of parameter PARAM. | 1594 | /* Return the value of parameter PARAM. |
| @@ -1600,6 +1639,9 @@ x_get_arg (alist, param, attribute, type) | |||
| 1600 | case string: | 1639 | case string: |
| 1601 | return tem; | 1640 | return tem; |
| 1602 | 1641 | ||
| 1642 | case symbol: | ||
| 1643 | return intern (tem); | ||
| 1644 | |||
| 1603 | default: | 1645 | default: |
| 1604 | abort (); | 1646 | abort (); |
| 1605 | } | 1647 | } |
| @@ -1713,8 +1755,8 @@ x_figure_window_size (f, parms) | |||
| 1713 | f->display.x->top_pos = 1; | 1755 | f->display.x->top_pos = 1; |
| 1714 | f->display.x->left_pos = 1; | 1756 | f->display.x->left_pos = 1; |
| 1715 | 1757 | ||
| 1716 | tem0 = x_get_arg (parms, Qheight, 0, 0); | 1758 | tem0 = x_get_arg (parms, Qheight, 0, number); |
| 1717 | tem1 = x_get_arg (parms, Qwidth, 0, 0); | 1759 | tem1 = x_get_arg (parms, Qwidth, 0, number); |
| 1718 | if (! EQ (tem0, Qunbound) && ! EQ (tem1, Qunbound)) | 1760 | if (! EQ (tem0, Qunbound) && ! EQ (tem1, Qunbound)) |
| 1719 | { | 1761 | { |
| 1720 | CHECK_NUMBER (tem0, 0); | 1762 | CHECK_NUMBER (tem0, 0); |
| @@ -1731,8 +1773,8 @@ x_figure_window_size (f, parms) | |||
| 1731 | f->display.x->pixel_height = (FONT_HEIGHT (f->display.x->font) * f->height | 1773 | f->display.x->pixel_height = (FONT_HEIGHT (f->display.x->font) * f->height |
| 1732 | + 2 * f->display.x->internal_border_width); | 1774 | + 2 * f->display.x->internal_border_width); |
| 1733 | 1775 | ||
| 1734 | tem0 = x_get_arg (parms, Qtop, 0, 0); | 1776 | tem0 = x_get_arg (parms, Qtop, 0, number); |
| 1735 | tem1 = x_get_arg (parms, Qleft, 0, 0); | 1777 | tem1 = x_get_arg (parms, Qleft, 0, number); |
| 1736 | if (! EQ (tem0, Qunbound) && ! EQ (tem1, Qunbound)) | 1778 | if (! EQ (tem0, Qunbound) && ! EQ (tem1, Qunbound)) |
| 1737 | { | 1779 | { |
| 1738 | CHECK_NUMBER (tem0, 0); | 1780 | CHECK_NUMBER (tem0, 0); |
| @@ -1817,7 +1859,7 @@ x_window (f) | |||
| 1817 | Lisp_Object name = f->name; | 1859 | Lisp_Object name = f->name; |
| 1818 | 1860 | ||
| 1819 | f->name = Qnil; | 1861 | f->name = Qnil; |
| 1820 | x_set_name (f, name, Qnil); | 1862 | x_implicitly_set_name (f, name, Qnil); |
| 1821 | } | 1863 | } |
| 1822 | 1864 | ||
| 1823 | XDefineCursor (XDISPLAY f->display.x->window_desc, | 1865 | XDefineCursor (XDISPLAY f->display.x->window_desc, |
| @@ -1841,8 +1883,8 @@ x_icon (f, parms) | |||
| 1841 | 1883 | ||
| 1842 | /* Set the position of the icon. Note that twm groups all | 1884 | /* Set the position of the icon. Note that twm groups all |
| 1843 | icons in an icon window. */ | 1885 | icons in an icon window. */ |
| 1844 | icon_x = x_get_arg (parms, Qicon_left, 0, 0); | 1886 | icon_x = x_get_arg (parms, Qicon_left, 0, number); |
| 1845 | icon_y = x_get_arg (parms, Qicon_top, 0, 0); | 1887 | icon_y = x_get_arg (parms, Qicon_top, 0, number); |
| 1846 | if (!EQ (icon_x, Qunbound) && !EQ (icon_y, Qunbound)) | 1888 | if (!EQ (icon_x, Qunbound) && !EQ (icon_y, Qunbound)) |
| 1847 | { | 1889 | { |
| 1848 | CHECK_NUMBER (icon_x, 0); | 1890 | CHECK_NUMBER (icon_x, 0); |
| @@ -1861,9 +1903,11 @@ x_icon (f, parms) | |||
| 1861 | x_wm_set_icon_position (f, XINT (icon_x), XINT (icon_y)); | 1903 | x_wm_set_icon_position (f, XINT (icon_x), XINT (icon_y)); |
| 1862 | 1904 | ||
| 1863 | /* Start up iconic or window? */ | 1905 | /* Start up iconic or window? */ |
| 1864 | x_wm_set_window_state (f, (EQ (x_get_arg (parms, Qiconic_startup, 0, 0), Qt) | 1906 | x_wm_set_window_state (f, |
| 1865 | ? IconicState | 1907 | (EQ (x_get_arg (parms, Qiconic_startup, 0, boolean), |
| 1866 | : NormalState)); | 1908 | Qt) |
| 1909 | ? IconicState | ||
| 1910 | : NormalState)); | ||
| 1867 | 1911 | ||
| 1868 | UNBLOCK_INPUT; | 1912 | UNBLOCK_INPUT; |
| 1869 | } | 1913 | } |
| @@ -1872,6 +1916,14 @@ x_icon (f, parms) | |||
| 1872 | background, border and mouse colors; also create the | 1916 | background, border and mouse colors; also create the |
| 1873 | mouse cursor and the gray border tile. */ | 1917 | mouse cursor and the gray border tile. */ |
| 1874 | 1918 | ||
| 1919 | static char cursor_bits[] = | ||
| 1920 | { | ||
| 1921 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
| 1922 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
| 1923 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
| 1924 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 | ||
| 1925 | }; | ||
| 1926 | |||
| 1875 | static void | 1927 | static void |
| 1876 | x_make_gc (f) | 1928 | x_make_gc (f) |
| 1877 | struct frame *f; | 1929 | struct frame *f; |
| @@ -1879,13 +1931,6 @@ x_make_gc (f) | |||
| 1879 | XGCValues gc_values; | 1931 | XGCValues gc_values; |
| 1880 | GC temp_gc; | 1932 | GC temp_gc; |
| 1881 | XImage tileimage; | 1933 | XImage tileimage; |
| 1882 | static char cursor_bits[] = | ||
| 1883 | { | ||
| 1884 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
| 1885 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
| 1886 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
| 1887 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 | ||
| 1888 | }; | ||
| 1889 | 1934 | ||
| 1890 | /* Create the GC's of this frame. | 1935 | /* Create the GC's of this frame. |
| 1891 | Note that many default values are used. */ | 1936 | Note that many default values are used. */ |
| @@ -1984,7 +2029,7 @@ be shared by the new frame.") | |||
| 1984 | if (XTYPE (name) != Lisp_String) | 2029 | if (XTYPE (name) != Lisp_String) |
| 1985 | error ("x-create-frame: name parameter must be a string"); | 2030 | error ("x-create-frame: name parameter must be a string"); |
| 1986 | 2031 | ||
| 1987 | tem = x_get_arg (parms, Qminibuffer, 0, 0); | 2032 | tem = x_get_arg (parms, Qminibuffer, 0, symbol); |
| 1988 | if (EQ (tem, Qnone) || NILP (tem)) | 2033 | if (EQ (tem, Qnone) || NILP (tem)) |
| 1989 | f = make_frame_without_minibuffer (Qnil); | 2034 | f = make_frame_without_minibuffer (Qnil); |
| 1990 | else if (EQ (tem, Qonly)) | 2035 | else if (EQ (tem, Qonly)) |
| @@ -2031,6 +2076,22 @@ be shared by the new frame.") | |||
| 2031 | x_default_parameter (f, parms, Qborder_color, | 2076 | x_default_parameter (f, parms, Qborder_color, |
| 2032 | build_string ("black"), "border", string); | 2077 | build_string ("black"), "border", string); |
| 2033 | 2078 | ||
| 2079 | /* When XSetWMHints eventually gets called, this will indicate that | ||
| 2080 | we use the "Passive Input" input model. Unless we do this, we | ||
| 2081 | don't get the Focus{In,Out} events that we need to draw the | ||
| 2082 | cursor correctly. Accursed bureaucrats. | ||
| 2083 | |||
| 2084 | We set this here and leave it, because we know, being decidedly | ||
| 2085 | non-humble programmers (nay, weigh'd low by our hubris!), that | ||
| 2086 | Fx_create_frame calls x_icon which begat x_wm_set_window_state | ||
| 2087 | which begat XSetWMHints, which will get this information to the | ||
| 2088 | right parties. -JimB | ||
| 2089 | |||
| 2090 | XWhipsAndChains (x_current_display, IronMaiden, &TheRack); */ | ||
| 2091 | |||
| 2092 | f->display.x->wm_hints.input = True; | ||
| 2093 | f->display.x->wm_hints.flags |= InputHint; | ||
| 2094 | |||
| 2034 | f->display.x->parent_desc = ROOT_WINDOW; | 2095 | f->display.x->parent_desc = ROOT_WINDOW; |
| 2035 | window_prompting = x_figure_window_size (f, parms); | 2096 | window_prompting = x_figure_window_size (f, parms); |
| 2036 | 2097 | ||
| @@ -2040,7 +2101,7 @@ be shared by the new frame.") | |||
| 2040 | 2101 | ||
| 2041 | /* We need to do this after creating the X window, so that the | 2102 | /* We need to do this after creating the X window, so that the |
| 2042 | icon-creation functions can say whose icon they're describing. */ | 2103 | icon-creation functions can say whose icon they're describing. */ |
| 2043 | x_default_parameter (f, parms, Qicon_type, Qt, "IconType", boolean); | 2104 | x_default_parameter (f, parms, Qicon_type, Qnil, "IconType", symbol); |
| 2044 | 2105 | ||
| 2045 | x_default_parameter (f, parms, Qauto_raise, Qnil, "AutoRaise", boolean); | 2106 | x_default_parameter (f, parms, Qauto_raise, Qnil, "AutoRaise", boolean); |
| 2046 | x_default_parameter (f, parms, Qauto_lower, Qnil, "AutoLower", boolean); | 2107 | x_default_parameter (f, parms, Qauto_lower, Qnil, "AutoLower", boolean); |
| @@ -2056,17 +2117,17 @@ be shared by the new frame.") | |||
| 2056 | x_wm_set_size_hint (f, window_prompting); | 2117 | x_wm_set_size_hint (f, window_prompting); |
| 2057 | UNBLOCK_INPUT; | 2118 | UNBLOCK_INPUT; |
| 2058 | 2119 | ||
| 2059 | tem = x_get_arg (parms, Qunsplittable, 0, 0); | 2120 | tem = x_get_arg (parms, Qunsplittable, 0, boolean); |
| 2060 | f->no_split = minibuffer_only || EQ (tem, Qt); | 2121 | f->no_split = minibuffer_only || EQ (tem, Qt); |
| 2061 | 2122 | ||
| 2062 | /* Now handle the rest of the parameters. */ | 2123 | /* Now handle the rest of the parameters. */ |
| 2063 | x_default_parameter (f, parms, Qhorizontal_scroll_bar, | 2124 | x_default_parameter (f, parms, Qhorizontal_scroll_bar, |
| 2064 | Qnil, "?HScrollBar", string); | 2125 | Qnil, "HScrollBar", boolean); |
| 2065 | x_default_parameter (f, parms, Qvertical_scroll_bar, | 2126 | x_default_parameter (f, parms, Qvertical_scroll_bar, |
| 2066 | Qnil, "?VScrollBar", string); | 2127 | Qnil, "VScrollBar", boolean); |
| 2067 | 2128 | ||
| 2068 | /* Make the window appear on the frame and enable display. */ | 2129 | /* Make the window appear on the frame and enable display. */ |
| 2069 | if (!EQ (x_get_arg (parms, Qsuppress_initial_map, 0, 0), Qt)) | 2130 | if (!EQ (x_get_arg (parms, Qsuppress_initial_map, 0, boolean), Qt)) |
| 2070 | x_make_frame_visible (f); | 2131 | x_make_frame_visible (f); |
| 2071 | 2132 | ||
| 2072 | return frame; | 2133 | return frame; |
| @@ -2087,9 +2148,7 @@ be shared by the new frame.") | |||
| 2087 | 2148 | ||
| 2088 | name = Fassq (Qname, parms); | 2149 | name = Fassq (Qname, parms); |
| 2089 | 2150 | ||
| 2090 | tem = x_get_arg (parms, Qminibuffer, 0, string); | 2151 | tem = x_get_arg (parms, Qminibuffer, 0, symbol); |
| 2091 | if (XTYPE (tem) == Lisp_String) | ||
| 2092 | tem = Fintern (tem, Qnil); | ||
| 2093 | if (EQ (tem, Qnone)) | 2152 | if (EQ (tem, Qnone)) |
| 2094 | f = make_frame_without_minibuffer (Qnil); | 2153 | f = make_frame_without_minibuffer (Qnil); |
| 2095 | else if (EQ (tem, Qonly)) | 2154 | else if (EQ (tem, Qonly)) |
| @@ -2181,29 +2240,29 @@ be shared by the new frame.") | |||
| 2181 | } | 2240 | } |
| 2182 | else | 2241 | else |
| 2183 | { | 2242 | { |
| 2184 | tem = x_get_arg (parms, Qparent_id, 0, 0); | 2243 | tem = x_get_arg (parms, Qparent_id, 0, number); |
| 2185 | if (!EQ (tem, Qunbound)) | 2244 | if (!EQ (tem, Qunbound)) |
| 2186 | { | 2245 | { |
| 2187 | CHECK_NUMBER (tem, 0); | 2246 | CHECK_NUMBER (tem, 0); |
| 2188 | parent = (Window) XINT (tem); | 2247 | parent = (Window) XINT (tem); |
| 2189 | } | 2248 | } |
| 2190 | f->display.x->parent_desc = parent; | 2249 | f->display.x->parent_desc = parent; |
| 2191 | tem = x_get_arg (parms, Qheight, 0, 0); | 2250 | tem = x_get_arg (parms, Qheight, 0, number); |
| 2192 | if (EQ (tem, Qunbound)) | 2251 | if (EQ (tem, Qunbound)) |
| 2193 | { | 2252 | { |
| 2194 | tem = x_get_arg (parms, Qwidth, 0, 0); | 2253 | tem = x_get_arg (parms, Qwidth, 0, number); |
| 2195 | if (EQ (tem, Qunbound)) | 2254 | if (EQ (tem, Qunbound)) |
| 2196 | { | 2255 | { |
| 2197 | tem = x_get_arg (parms, Qtop, 0, 0); | 2256 | tem = x_get_arg (parms, Qtop, 0, number); |
| 2198 | if (EQ (tem, Qunbound)) | 2257 | if (EQ (tem, Qunbound)) |
| 2199 | tem = x_get_arg (parms, Qleft, 0, 0); | 2258 | tem = x_get_arg (parms, Qleft, 0, number); |
| 2200 | } | 2259 | } |
| 2201 | } | 2260 | } |
| 2202 | /* Now TEM is Qunbound if no edge or size was specified. | 2261 | /* Now TEM is Qunbound if no edge or size was specified. |
| 2203 | In that case, we must do rubber-banding. */ | 2262 | In that case, we must do rubber-banding. */ |
| 2204 | if (EQ (tem, Qunbound)) | 2263 | if (EQ (tem, Qunbound)) |
| 2205 | { | 2264 | { |
| 2206 | tem = x_get_arg (parms, Qgeometry, 0, 0); | 2265 | tem = x_get_arg (parms, Qgeometry, 0, number); |
| 2207 | x_rubber_band (f, | 2266 | x_rubber_band (f, |
| 2208 | &f->display.x->left_pos, &f->display.x->top_pos, | 2267 | &f->display.x->left_pos, &f->display.x->top_pos, |
| 2209 | &width, &height, | 2268 | &width, &height, |
| @@ -2216,25 +2275,25 @@ be shared by the new frame.") | |||
| 2216 | { | 2275 | { |
| 2217 | /* Here if at least one edge or size was specified. | 2276 | /* Here if at least one edge or size was specified. |
| 2218 | Demand that they all were specified, and use them. */ | 2277 | Demand that they all were specified, and use them. */ |
| 2219 | tem = x_get_arg (parms, Qheight, 0, 0); | 2278 | tem = x_get_arg (parms, Qheight, 0, number); |
| 2220 | if (EQ (tem, Qunbound)) | 2279 | if (EQ (tem, Qunbound)) |
| 2221 | error ("Height not specified"); | 2280 | error ("Height not specified"); |
| 2222 | CHECK_NUMBER (tem, 0); | 2281 | CHECK_NUMBER (tem, 0); |
| 2223 | height = XINT (tem); | 2282 | height = XINT (tem); |
| 2224 | 2283 | ||
| 2225 | tem = x_get_arg (parms, Qwidth, 0, 0); | 2284 | tem = x_get_arg (parms, Qwidth, 0, number); |
| 2226 | if (EQ (tem, Qunbound)) | 2285 | if (EQ (tem, Qunbound)) |
| 2227 | error ("Width not specified"); | 2286 | error ("Width not specified"); |
| 2228 | CHECK_NUMBER (tem, 0); | 2287 | CHECK_NUMBER (tem, 0); |
| 2229 | width = XINT (tem); | 2288 | width = XINT (tem); |
| 2230 | 2289 | ||
| 2231 | tem = x_get_arg (parms, Qtop, 0, 0); | 2290 | tem = x_get_arg (parms, Qtop, 0, number); |
| 2232 | if (EQ (tem, Qunbound)) | 2291 | if (EQ (tem, Qunbound)) |
| 2233 | error ("Top position not specified"); | 2292 | error ("Top position not specified"); |
| 2234 | CHECK_NUMBER (tem, 0); | 2293 | CHECK_NUMBER (tem, 0); |
| 2235 | f->display.x->left_pos = XINT (tem); | 2294 | f->display.x->left_pos = XINT (tem); |
| 2236 | 2295 | ||
| 2237 | tem = x_get_arg (parms, Qleft, 0, 0); | 2296 | tem = x_get_arg (parms, Qleft, 0, number); |
| 2238 | if (EQ (tem, Qunbound)) | 2297 | if (EQ (tem, Qunbound)) |
| 2239 | error ("Left position not specified"); | 2298 | error ("Left position not specified"); |
| 2240 | CHECK_NUMBER (tem, 0); | 2299 | CHECK_NUMBER (tem, 0); |
| @@ -2274,16 +2333,16 @@ be shared by the new frame.") | |||
| 2274 | 2333 | ||
| 2275 | /* Now override the defaults with all the rest of the specified | 2334 | /* Now override the defaults with all the rest of the specified |
| 2276 | parms. */ | 2335 | parms. */ |
| 2277 | tem = x_get_arg (parms, Qunsplittable, 0, 0); | 2336 | tem = x_get_arg (parms, Qunsplittable, 0, boolean); |
| 2278 | f->no_split = minibuffer_only || EQ (tem, Qt); | 2337 | f->no_split = minibuffer_only || EQ (tem, Qt); |
| 2279 | 2338 | ||
| 2280 | /* Do not create an icon window if the caller says not to */ | 2339 | /* Do not create an icon window if the caller says not to */ |
| 2281 | if (!EQ (x_get_arg (parms, Qsuppress_icon, 0, 0), Qt) | 2340 | if (!EQ (x_get_arg (parms, Qsuppress_icon, 0, boolean), Qt) |
| 2282 | || f->display.x->parent_desc != ROOT_WINDOW) | 2341 | || f->display.x->parent_desc != ROOT_WINDOW) |
| 2283 | { | 2342 | { |
| 2284 | x_text_icon (f, iconidentity); | 2343 | x_text_icon (f, iconidentity); |
| 2285 | x_default_parameter (f, parms, Qicon_type, Qnil, | 2344 | x_default_parameter (f, parms, Qicon_type, Qnil, |
| 2286 | "BitmapIcon", boolean); | 2345 | "BitmapIcon", symbol); |
| 2287 | } | 2346 | } |
| 2288 | 2347 | ||
| 2289 | /* Tell the X server the previously set values of the | 2348 | /* Tell the X server the previously set values of the |
| @@ -2308,7 +2367,7 @@ be shared by the new frame.") | |||
| 2308 | 2367 | ||
| 2309 | /* Make the window appear on the frame and enable display. */ | 2368 | /* Make the window appear on the frame and enable display. */ |
| 2310 | 2369 | ||
| 2311 | if (!EQ (x_get_arg (parms, Qsuppress_initial_map, 0, 0), Qt)) | 2370 | if (!EQ (x_get_arg (parms, Qsuppress_initial_map, 0, boolean), Qt)) |
| 2312 | x_make_window_visible (f); | 2371 | x_make_window_visible (f); |
| 2313 | FRAME_GARBAGED (f); | 2372 | FRAME_GARBAGED (f); |
| 2314 | 2373 | ||
| @@ -4259,7 +4318,10 @@ select_visual (screen, depth) | |||
| 4259 | int n_visuals; | 4318 | int n_visuals; |
| 4260 | 4319 | ||
| 4261 | v = DefaultVisualOfScreen (screen); | 4320 | v = DefaultVisualOfScreen (screen); |
| 4262 | vinfo_template.visualid = XVisualIDFromVisual (v); | 4321 | /* It may be a bad idea to fetch the visualid directly from the structure, |
| 4322 | rather than using XVisualIDFromVisual, but I'll bet this is pretty | ||
| 4323 | portable for the revisions of X we care about. */ | ||
| 4324 | vinfo_template.visualid = v->visualid; | ||
| 4263 | vinfo = XGetVisualInfo (x_current_display, VisualIDMask, &vinfo_template, | 4325 | vinfo = XGetVisualInfo (x_current_display, VisualIDMask, &vinfo_template, |
| 4264 | &n_visuals); | 4326 | &n_visuals); |
| 4265 | if (n_visuals != 1) | 4327 | if (n_visuals != 1) |