aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Lohmann <20h@r-36.net>2013-02-23 21:20:21 +0100
committerChristoph Lohmann <20h@r-36.net>2013-02-23 21:20:21 +0100
commitefaf1c2a94ed9193c04c3a67f374d31f988b0e9a (patch)
treea672835ffdc469cb2f57146a60b685623c267bc0
parent1b6c6535c10172facb350f4b8fef442f7f8ddc5a (diff)
downloadst-efaf1c2a94ed9193c04c3a67f374d31f988b0e9a.tar.gz
st-efaf1c2a94ed9193c04c3a67f374d31f988b0e9a.tar.bz2
Add umlaut support for title change.
Thanks Alexander Sedov <alex0player@gmail.com>!
-rw-r--r--TODO1
-rw-r--r--st.c23
2 files changed, 12 insertions, 12 deletions
diff --git a/TODO b/TODO
index 2f42720..67615f8 100644
--- a/TODO
+++ b/TODO
@@ -18,7 +18,6 @@ bugs
* fix shift up/down (shift selection in emacs)
* fix selection paste for xatom STRING
-* fix umlaut handling in settitle
* fix rows and column definition in fixed geometry
* fix -e handling
* remove DEC test sequence when appropriate
diff --git a/st.c b/st.c
index c6a840d..6117c92 100644
--- a/st.c
+++ b/st.c
@@ -1861,12 +1861,9 @@ csireset(void) {
void
strhandle(void) {
char *p = NULL;
- int i, j;
- int narg;
+ int i, j, narg;
+ XTextProperty prop;
- /*
- * TODO: make this being useful in case of color palette change.
- */
strparse();
narg = strescseq.narg;
@@ -1876,11 +1873,12 @@ strhandle(void) {
case 0:
case 1:
case 2:
- /*
- * TODO: Handle special chars in string, like umlauts.
- */
- if(narg > 1)
- XStoreName(xw.dpy, xw.win, strescseq.args[2]);
+ if(narg > 1) {
+ p += 2;
+ Xutf8TextListToTextProperty(xw.dpy, &p, 1,
+ XUTF8StringStyle, &prop);
+ XSetWMName(xw.dpy, xw.win, &prop);
+ }
break;
case 4: /* color set */
if(narg < 3)
@@ -1902,7 +1900,10 @@ strhandle(void) {
}
break;
case 'k': /* old title set compatibility */
- XStoreName(xw.dpy, xw.win, strescseq.buf);
+ p += 1;
+ Xutf8TextListToTextProperty(xw.dpy, &p, 1, XUTF8StringStyle,
+ &prop);
+ XSetWMName(xw.dpy, xw.win, &prop);
break;
case 'P': /* DSC -- Device Control String */
case '_': /* APC -- Application Program Command */