Commit 6f08fd45 authored by Birte Kristina Friesel's avatar Birte Kristina Friesel
Browse files

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.
parent e06d459f
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -25,6 +25,8 @@ git HEAD
      <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=625683>
    * Fix --auto-zoom / --zoom max/fill documentation, the "Auto-Zoom" menu
      option is now always checked when these options are used
    * Set _NET_WM_NAME and _NET_WM_ICON_NAME properties
      <http://github.com/derf/feh/issues/44>

Sat, 23 Apr 2011 22:00:27 +0200  Daniel Friesel <derf@finalrewind.org>

+10 −1
Original line number Diff line number Diff line
@@ -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;
}