Mercurial > emacs
comparison src/xfns.c @ 91085:880960b70474
Merge from emacs--devo--0
Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-283
author | Miles Bader <miles@gnu.org> |
---|---|
date | Sun, 11 Nov 2007 00:56:44 +0000 |
parents | 4bc33ffdda1a fd9c2b6d11cb |
children | 53108e6cea98 |
comparison
equal
deleted
inserted
replaced
91084:a4347a111894 | 91085:880960b70474 |
---|---|
141 | 141 |
142 static Lisp_Object Vgtk_version_string; | 142 static Lisp_Object Vgtk_version_string; |
143 | 143 |
144 #endif /* USE_GTK */ | 144 #endif /* USE_GTK */ |
145 | 145 |
146 #ifdef HAVE_X11R4 | |
147 #define MAXREQUEST(dpy) (XMaxRequestSize (dpy)) | 146 #define MAXREQUEST(dpy) (XMaxRequestSize (dpy)) |
148 #else | |
149 #define MAXREQUEST(dpy) ((dpy)->max_request_size) | |
150 #endif | |
151 | 147 |
152 /* The gray bitmap `bitmaps/gray'. This is done because xterm.c uses | 148 /* The gray bitmap `bitmaps/gray'. This is done because xterm.c uses |
153 it, and including `bitmaps/gray' more than once is a problem when | 149 it, and including `bitmaps/gray' more than once is a problem when |
154 config.h defines `static' as an empty replacement string. */ | 150 config.h defines `static' as an empty replacement string. */ |
155 | 151 |
1599 Lisp_Object name; | 1595 Lisp_Object name; |
1600 { | 1596 { |
1601 if (FRAME_X_WINDOW (f)) | 1597 if (FRAME_X_WINDOW (f)) |
1602 { | 1598 { |
1603 BLOCK_INPUT; | 1599 BLOCK_INPUT; |
1604 #ifdef HAVE_X11R4 | |
1605 { | 1600 { |
1606 XTextProperty text, icon; | 1601 XTextProperty text, icon; |
1607 int bytes, stringp; | 1602 int bytes, stringp; |
1608 int do_free_icon_value = 0, do_free_text_value = 0; | 1603 int do_free_icon_value = 0, do_free_text_value = 0; |
1609 Lisp_Object coding_system; | 1604 Lisp_Object coding_system; |
1667 if (do_free_icon_value) | 1662 if (do_free_icon_value) |
1668 xfree (icon.value); | 1663 xfree (icon.value); |
1669 if (do_free_text_value) | 1664 if (do_free_text_value) |
1670 xfree (text.value); | 1665 xfree (text.value); |
1671 } | 1666 } |
1672 #else /* not HAVE_X11R4 */ | |
1673 XSetIconName (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), | |
1674 SDATA (name)); | |
1675 XStoreName (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), | |
1676 SDATA (name)); | |
1677 #endif /* not HAVE_X11R4 */ | |
1678 UNBLOCK_INPUT; | 1667 UNBLOCK_INPUT; |
1679 } | 1668 } |
1680 } | 1669 } |
1681 | 1670 |
1682 /* Change the name of frame F to NAME. If NAME is nil, set F's name to | 1671 /* Change the name of frame F to NAME. If NAME is nil, set F's name to |
1859 return tem; | 1848 return tem; |
1860 } | 1849 } |
1861 | 1850 |
1862 | 1851 |
1863 | 1852 |
1864 #if !defined (HAVE_X11R4) && !defined (HAVE_XSETWMPROTOCOLS) | |
1865 | |
1866 Status | |
1867 XSetWMProtocols (dpy, w, protocols, count) | |
1868 Display *dpy; | |
1869 Window w; | |
1870 Atom *protocols; | |
1871 int count; | |
1872 { | |
1873 Atom prop; | |
1874 prop = XInternAtom (dpy, "WM_PROTOCOLS", False); | |
1875 if (prop == None) return False; | |
1876 XChangeProperty (dpy, w, prop, XA_ATOM, 32, PropModeReplace, | |
1877 (unsigned char *) protocols, count); | |
1878 return True; | |
1879 } | |
1880 #endif /* not HAVE_X11R4 && not HAVE_XSETWMPROTOCOLS */ | |
1881 | 1853 |
1882 #ifdef USE_X_TOOLKIT | 1854 #ifdef USE_X_TOOLKIT |
1883 | 1855 |
1884 /* If the WM_PROTOCOLS property does not already contain WM_TAKE_FOCUS, | 1856 /* If the WM_PROTOCOLS property does not already contain WM_TAKE_FOCUS, |
1885 WM_DELETE_WINDOW, and WM_SAVE_YOURSELF, then add them. (They may | 1857 WM_DELETE_WINDOW, and WM_SAVE_YOURSELF, then add them. (They may |
4218 int n_visuals; | 4190 int n_visuals; |
4219 XVisualInfo *vinfo, vinfo_template; | 4191 XVisualInfo *vinfo, vinfo_template; |
4220 | 4192 |
4221 dpyinfo->visual = DefaultVisualOfScreen (screen); | 4193 dpyinfo->visual = DefaultVisualOfScreen (screen); |
4222 | 4194 |
4223 #ifdef HAVE_X11R4 | |
4224 vinfo_template.visualid = XVisualIDFromVisual (dpyinfo->visual); | 4195 vinfo_template.visualid = XVisualIDFromVisual (dpyinfo->visual); |
4225 #else | |
4226 vinfo_template.visualid = dpyinfo->visual->visualid; | |
4227 #endif | |
4228 vinfo_template.screen = XScreenNumberOfScreen (screen); | 4196 vinfo_template.screen = XScreenNumberOfScreen (screen); |
4229 vinfo = XGetVisualInfo (dpy, VisualIDMask | VisualScreenMask, | 4197 vinfo = XGetVisualInfo (dpy, VisualIDMask | VisualScreenMask, |
4230 &vinfo_template, &n_visuals); | 4198 &vinfo_template, &n_visuals); |
4231 if (n_visuals != 1) | 4199 if (n_visuals != 1) |
4232 fatal ("Can't get proper X visual info"); | 4200 fatal ("Can't get proper X visual info"); |