summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2011-05-10 11:42:33 +0200
committerDaniel Friesel <derf@finalrewind.org>2011-05-10 11:42:33 +0200
commit6f08fd4510dd426322af28b3bf982bb44f218465 (patch)
tree115664f7da9117de2e12cfdf621db09dac245346 /src
parente06d459f5732e05a91ba19b95f8392fbf004bd19 (diff)
winwidget.c: Set _NET_WM_NAME and _NET_WM_ICON_NAME, marked as utf8 (closes #44)
Note that feh does not try to convert encodings or anything. It expects filenames to be in UTF8 and passe them on to NET_WM_NAME and NET_WM_ICON NAME. The only new thing is that it now also sets _NET_WM_NAME and _NET_WM_ICON_NAME and explicitly tells X11 that they are in UTF-8. Again, no recode, if you use UTF-8 filesystems (which you should), everything is fine.
Diffstat (limited to 'src')
-rw-r--r--src/winwidget.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/winwidget.c b/src/winwidget.c
index 964c835..599e4bf 100644
--- a/src/winwidget.c
+++ b/src/winwidget.c
@@ -302,12 +302,21 @@ void winwidget_create_window(winwidget ret, int w, int h)
void winwidget_update_title(winwidget ret)
{
char *name;
+ Atom prop_name = XInternAtom(disp, "_NET_WM_NAME", False);
+ Atom prop_icon = XInternAtom(disp, "_NET_WM_ICON_NAME", False);
+ Atom prop_utf8 = XInternAtom(disp, "UTF8_STRING", False);
D(("winwid->name = %s\n", ret->name));
name = ret->name ? ret->name : "feh";
XStoreName(disp, ret->win, name);
XSetIconName(disp, ret->win, name);
- /* XFlush(disp); */
+
+ XChangeProperty(disp, ret->win, prop_name, prop_utf8, 8,
+ PropModeReplace, (const unsigned char *)name, strlen(name));
+
+ XChangeProperty(disp, ret->win, prop_icon, prop_utf8, 8,
+ PropModeReplace, (const unsigned char *)name, strlen(name));
+
return;
}