To: vim-dev@vim.org Subject: Patch 6.1.467 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit ------------ Patch 6.1.467 Problem: Setting the window title doesn't work for Chinese. Solution: Use an X11 function to convert text to a text property. (Kentaro Nakazawa) Files: src/os_unix.c *** ../vim61.466/src/os_unix.c Mon Mar 31 20:44:10 2003 --- src/os_unix.c Mon Apr 14 21:19:42 2003 *************** *** 1547,1559 **** char_u *title; { #if XtSpecificationRelease >= 4 ! XTextProperty text_prop; ! text_prop.value = title; ! text_prop.nitems = STRLEN(title); ! text_prop.encoding = XA_STRING; ! text_prop.format = 8; XSetWMName(x11_display, x11_window, &text_prop); #else XStoreName(x11_display, x11_window, (char *)title); #endif --- 1564,1590 ---- char_u *title; { #if XtSpecificationRelease >= 4 ! XTextProperty text_prop; ! # ifdef FEAT_XFONTSET ! Status status; ! status = XmbTextListToTextProperty(x11_display, (char **)&title, 1, ! XCompoundTextStyle, &text_prop); ! /* Status is a positive number when some chars could not be converted. ! * Accept that, we don't know what to do otherwise. */ ! if (status < Success) ! # endif ! { ! text_prop.value = title; ! text_prop.nitems = STRLEN(title); ! text_prop.encoding = XA_STRING; ! text_prop.format = 8; ! } XSetWMName(x11_display, x11_window, &text_prop); + # ifdef FEAT_XFONTSET + if (status >= Success) + XFree((void *)text_prop.value); + # endif #else XStoreName(x11_display, x11_window, (char *)title); #endif *************** *** 1570,1582 **** char_u *icon; { #if XtSpecificationRelease >= 4 ! XTextProperty text_prop; ! text_prop.value = icon; ! text_prop.nitems = STRLEN(icon); ! text_prop.encoding = XA_STRING; ! text_prop.format = 8; XSetWMIconName(x11_display, x11_window, &text_prop); #else XSetIconName(x11_display, x11_window, (char *)icon); #endif --- 1601,1627 ---- char_u *icon; { #if XtSpecificationRelease >= 4 ! XTextProperty text_prop; ! # ifdef FEAT_XFONTSET ! Status status; ! status = XmbTextListToTextProperty(x11_display, (char **)&icon, 1, ! XCompoundTextStyle, &text_prop); ! /* Status is a positive number when some chars could not be converted. ! * Accept that, we don't know what to do otherwise. */ ! if (status < Success) ! # endif ! { ! text_prop.value = icon; ! text_prop.nitems = STRLEN(icon); ! text_prop.encoding = XA_STRING; ! text_prop.format = 8; ! } XSetWMIconName(x11_display, x11_window, &text_prop); + # ifdef FEAT_XFONTSET + if (status >= Success) + XFree((void *)text_prop.value); + # endif #else XSetIconName(x11_display, x11_window, (char *)icon); #endif *** ../vim61.466/src/version.c Wed Apr 16 20:43:41 2003 --- src/version.c Wed Apr 16 20:51:44 2003 *************** *** 613,614 **** --- 613,616 ---- { /* Add new patch number below this line */ + /**/ + 467, /**/ -- While it's true that many normal people whould prefer not to _date_ an engineer, most normal people harbor an intense desire to _mate_ with them, thus producing engineerlike children who will have high-paying jobs long before losing their virginity. (Scott Adams - The Dilbert principle) /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// Creator of Vim - Vi IMproved -- http://www.Vim.org \\\ \\\ Project leader for A-A-P -- http://www.A-A-P.org /// \\\ Help AIDS victims, buy at Amazon -- http://ICCF.nl/click1.html ///