4 From: Bram Moolenaar <Bram@moolenaar.net>
6 Content-Type: text/plain; charset=ISO-8859-1
7 Content-Transfer-Encoding: 8bit
11 Problem: Title doesn't work with some window managers. X11: Setting the
12 text property for the window title is hard coded.
13 Solution: Use STRING format when possible. Use the UTF-8 function when
14 it's available and 'encoding' is utf-8. Use
15 XStringListToTextProperty(). Do the same for the icon name.
20 *** ../vim-6.2.342/src/os_unix.c Fri Mar 5 15:21:09 2004
21 --- src/os_unix.c Thu Mar 11 20:54:54 2004
28 + /* Are Xutf8 functions available? Avoid error from old compilers. */
29 + #if defined(X_HAVE_UTF8_STRING) && defined(FEAT_MBYTE)
30 + # if X_HAVE_UTF8_STRING
31 + # define USE_UTF8_STRING
36 * Set x11 Window Title
43 #if XtSpecificationRelease >= 4
44 - XTextProperty text_prop;
48 ! status = XmbTextListToTextProperty(x11_display, (char **)&title, 1,
49 ! XCompoundTextStyle, &text_prop);
50 ! /* Status is a positive number when some chars could not be converted.
51 ! * Accept that, we don't know what to do otherwise. */
52 ! if (status < Success)
55 ! text_prop.value = title;
56 ! text_prop.nitems = STRLEN(title);
57 ! text_prop.encoding = XA_STRING;
58 ! text_prop.format = 8;
60 ! XSetWMName(x11_display, x11_window, &text_prop);
61 ! # ifdef FEAT_XFONTSET
62 ! if (status >= Success)
63 ! XFree((void *)text_prop.value);
66 ! XStoreName(x11_display, x11_window, (char *)title);
75 + /* XmbSetWMProperties() and Xutf8SetWMProperties() should use a STRING
76 + * when possible, COMPOUND_TEXT otherwise. COMPOUND_TEXT isn't
77 + * supported everywhere and STRING doesn't work for multi-byte titles.
79 + #ifdef USE_UTF8_STRING
81 + Xutf8SetWMProperties(x11_display, x11_window, (const char *)title,
82 + NULL, NULL, 0, NULL, NULL, NULL);
86 #if XtSpecificationRelease >= 4
88 ! XmbSetWMProperties(x11_display, x11_window, (const char *)title,
89 ! NULL, NULL, 0, NULL, NULL, NULL);
91 ! XTextProperty text_prop;
93 ! /* directly from example 3-18 "basicwin" of Xlib Programming Manual */
94 ! (void)XStringListToTextProperty((char **)&title, 1, &text_prop);
95 ! XSetWMProperties(x11_display, x11_window, &text_prop,
96 ! NULL, NULL, 0, NULL, NULL, NULL);
99 ! XStoreName(x11_display, x11_window, (char *)title);
110 #if XtSpecificationRelease >= 4
111 - XTextProperty text_prop;
112 # ifdef FEAT_XFONTSET
115 ! status = XmbTextListToTextProperty(x11_display, (char **)&icon, 1,
116 ! XCompoundTextStyle, &text_prop);
117 ! /* Status is a positive number when some chars could not be converted.
118 ! * Accept that, we don't know what to do otherwise. */
119 ! if (status < Success)
122 ! text_prop.value = icon;
123 ! text_prop.nitems = STRLEN(icon);
124 ! text_prop.encoding = XA_STRING;
125 ! text_prop.format = 8;
127 ! XSetWMIconName(x11_display, x11_window, &text_prop);
128 ! # ifdef FEAT_XFONTSET
129 ! if (status >= Success)
130 ! XFree((void *)text_prop.value);
133 ! XSetIconName(x11_display, x11_window, (char *)icon);
142 + /* See above for comments about using X*SetWMProperties(). */
143 + #ifdef USE_UTF8_STRING
145 + Xutf8SetWMProperties(x11_display, x11_window, NULL, (const char *)icon,
146 + NULL, 0, NULL, NULL, NULL);
150 #if XtSpecificationRelease >= 4
151 # ifdef FEAT_XFONTSET
152 ! XmbSetWMProperties(x11_display, x11_window, NULL, (const char *)icon,
153 ! NULL, 0, NULL, NULL, NULL);
155 ! XTextProperty text_prop;
157 ! (void)XStringListToTextProperty((char **)&icon, 1, &text_prop);
158 ! XSetWMProperties(x11_display, x11_window, NULL, &text_prop,
159 ! NULL, 0, NULL, NULL, NULL);
162 ! XSetIconName(x11_display, x11_window, (char *)icon);
168 *** ../vim-6.2.342/src/version.c Thu Mar 11 20:49:02 2004
169 --- src/version.c Thu Mar 11 20:50:31 2004
173 { /* Add new patch number below this line */
179 hundred-and-one symptoms of being an internet addict:
180 6. You refuse to go to a vacation spot with no electricity and no phone lines.
182 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
183 /// Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
184 \\\ Project leader for A-A-P -- http://www.A-A-P.org ///
185 \\\ Buy at Amazon and help AIDS victims -- http://ICCF.nl/click1.html ///