diff options
| author | Richard M. Stallman | 1993-12-23 01:00:49 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1993-12-23 01:00:49 +0000 |
| commit | f58534a3faddd86cf1dea26195db461b16b1bbd8 (patch) | |
| tree | 70f389895642394f22d5470c91462091cb8d3a47 /src | |
| parent | 693882381216116de1cc113a565a5a6df1fadc8e (diff) | |
| download | emacs-f58534a3faddd86cf1dea26195db461b16b1bbd8.tar.gz emacs-f58534a3faddd86cf1dea26195db461b16b1bbd8.zip | |
(Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
(Fx_create_frame): Add frame to Vframe_list.
(Fx_create_frame): Fix order of arguments of
x_wm_set_size_hint call. This corrects handling of +x-y and -x+y
geometry specifications.
(XSetWMProtocols): New function, defined conditionally.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xfns.c | 61 |
1 files changed, 52 insertions, 9 deletions
diff --git a/src/xfns.c b/src/xfns.c index 754389db743..2de9158466f 100644 --- a/src/xfns.c +++ b/src/xfns.c | |||
| @@ -1529,6 +1529,24 @@ x_figure_window_size (f, parms) | |||
| 1529 | return window_prompting; | 1529 | return window_prompting; |
| 1530 | } | 1530 | } |
| 1531 | 1531 | ||
| 1532 | #if !defined (HAVE_X11R4) && !defined (HAVE_XSETWMPROTOCOLS) | ||
| 1533 | |||
| 1534 | Status | ||
| 1535 | XSetWMProtocols (dpy, w, protocols, count) | ||
| 1536 | Display *dpy; | ||
| 1537 | Window w; | ||
| 1538 | Atom *protocols; | ||
| 1539 | int count; | ||
| 1540 | { | ||
| 1541 | Atom prop; | ||
| 1542 | prop = XInternAtom (dpy, "WM_PROTOCOLS", False); | ||
| 1543 | if (prop == None) return False; | ||
| 1544 | XChangeProperty (dpy, w, prop, XA_ATOM, 32, PropModeReplace, | ||
| 1545 | (unsigned char *) protocols, count); | ||
| 1546 | return True; | ||
| 1547 | } | ||
| 1548 | #endif /* !HAVE_X11R4 && !HAVE_XSETWMPROTOCOLS */ | ||
| 1549 | |||
| 1532 | static void | 1550 | static void |
| 1533 | x_window (f) | 1551 | x_window (f) |
| 1534 | struct frame *f; | 1552 | struct frame *f; |
| @@ -1865,8 +1883,8 @@ be shared by the new frame.") | |||
| 1865 | x_default_parameter (f, parms, Qmenu_bar_lines, make_number (0), | 1883 | x_default_parameter (f, parms, Qmenu_bar_lines, make_number (0), |
| 1866 | "menuBarLines", "MenuBarLines", number); | 1884 | "menuBarLines", "MenuBarLines", number); |
| 1867 | 1885 | ||
| 1868 | tem0 = x_get_arg (parms, Qtop, 0, 0, number); | 1886 | tem0 = x_get_arg (parms, Qleft, 0, 0, number); |
| 1869 | tem1 = x_get_arg (parms, Qleft, 0, 0, number); | 1887 | tem1 = x_get_arg (parms, Qtop, 0, 0, number); |
| 1870 | BLOCK_INPUT; | 1888 | BLOCK_INPUT; |
| 1871 | x_wm_set_size_hint (f, window_prompting, XINT (tem0), XINT (tem1)); | 1889 | x_wm_set_size_hint (f, window_prompting, XINT (tem0), XINT (tem1)); |
| 1872 | UNBLOCK_INPUT; | 1890 | UNBLOCK_INPUT; |
| @@ -1891,6 +1909,7 @@ be shared by the new frame.") | |||
| 1891 | ; | 1909 | ; |
| 1892 | } | 1910 | } |
| 1893 | 1911 | ||
| 1912 | Vframe_list = Fcons (frame, Vframe_list); | ||
| 1894 | return frame; | 1913 | return frame; |
| 1895 | #else /* X10 */ | 1914 | #else /* X10 */ |
| 1896 | struct frame *f; | 1915 | struct frame *f; |
| @@ -2129,6 +2148,7 @@ be shared by the new frame.") | |||
| 2129 | 2148 | ||
| 2130 | SET_FRAME_GARBAGED (f); | 2149 | SET_FRAME_GARBAGED (f); |
| 2131 | 2150 | ||
| 2151 | Vframe_list = Fcons (frame, Vframe_list); | ||
| 2132 | return frame; | 2152 | return frame; |
| 2133 | #endif /* X10 */ | 2153 | #endif /* X10 */ |
| 2134 | } | 2154 | } |
| @@ -2293,11 +2313,20 @@ fonts), even if they match PATTERN and FACE.") | |||
| 2293 | } | 2313 | } |
| 2294 | 2314 | ||
| 2295 | BLOCK_INPUT; | 2315 | BLOCK_INPUT; |
| 2316 | |||
| 2317 | /* Solaris 2.3 has a bug in XListFontsWithInfo. */ | ||
| 2318 | #ifdef BROKEN_XLISTFONTSWITHINFO | ||
| 2319 | names = XListFonts (x_current_display, | ||
| 2320 | XSTRING (pattern)->data, | ||
| 2321 | 2000, /* maxnames */ | ||
| 2322 | &num_fonts); /* count_return */ | ||
| 2323 | #else | ||
| 2296 | names = XListFontsWithInfo (x_current_display, | 2324 | names = XListFontsWithInfo (x_current_display, |
| 2297 | XSTRING (pattern)->data, | 2325 | XSTRING (pattern)->data, |
| 2298 | 2000, /* maxnames */ | 2326 | 2000, /* maxnames */ |
| 2299 | &num_fonts, /* count_return */ | 2327 | &num_fonts, /* count_return */ |
| 2300 | &info); /* info_return */ | 2328 | &info); /* info_return */ |
| 2329 | #endif | ||
| 2301 | UNBLOCK_INPUT; | 2330 | UNBLOCK_INPUT; |
| 2302 | 2331 | ||
| 2303 | list = Qnil; | 2332 | list = Qnil; |
| @@ -2307,16 +2336,30 @@ fonts), even if they match PATTERN and FACE.") | |||
| 2307 | Lisp_Object *tail; | 2336 | Lisp_Object *tail; |
| 2308 | int i; | 2337 | int i; |
| 2309 | 2338 | ||
| 2310 | tail = &list; | ||
| 2311 | for (i = 0; i < num_fonts; i++) | 2339 | for (i = 0; i < num_fonts; i++) |
| 2312 | if (! size_ref | 2340 | { |
| 2313 | || same_size_fonts (&info[i], size_ref)) | 2341 | #ifdef BROKEN_XLISTFONTSWITHINFO |
| 2314 | { | 2342 | BLOCK_INPUT; |
| 2315 | *tail = Fcons (build_string (names[i]), Qnil); | 2343 | info = XLoadQueryFont (x_current_display, names[i]); |
| 2316 | tail = &XCONS (*tail)->cdr; | 2344 | UNBLOCK_INPUT; |
| 2317 | } | 2345 | #else |
| 2346 | info = &info[i]; | ||
| 2347 | #endif | ||
| 2348 | if (info && (! size_ref | ||
| 2349 | || same_size_fonts (info, size_ref))) | ||
| 2350 | { | ||
| 2351 | *tail = Fcons (build_string (names[i]), Qnil); | ||
| 2352 | tail = &XCONS (*tail)->cdr; | ||
| 2353 | } | ||
| 2354 | } | ||
| 2318 | 2355 | ||
| 2356 | BLOCK_INPUT; | ||
| 2357 | #ifdef BROKEN_XLISTFONTSWITHINFO | ||
| 2358 | XFreeFontNames (names); | ||
| 2359 | #else | ||
| 2319 | XFreeFontInfo (names, info, num_fonts); | 2360 | XFreeFontInfo (names, info, num_fonts); |
| 2361 | #endif | ||
| 2362 | UNBLOCK_INPUT; | ||
| 2320 | } | 2363 | } |
| 2321 | 2364 | ||
| 2322 | return list; | 2365 | return list; |