WM_CLASS fix for Unity dock

Added by Roman Kubar over 9 years ago

This is the fix for better Unity integration.
It adds WM_CLASS property to window.
My C skill is not so good (3 yers not to program in C) improve would be nice if any.
I use git version 30.12.11
in src/ui/glw/glw_x11.c
in line # 36 after
#include <X11/XF86keysym.h>
insert
#include <X11/Xutil.h>
in line # 347 after
XSetWMName(gx11->display, gx11->win, &text);
insert
XClassHint* classHint = XAllocClassHint();
classHint->res_name = buf;
classHint->res_class = buf;
XSetClassHint(gx11->display, gx11->win, classHint);
before
XSetWMProtocols(gx11->display, gx11->win, &gx11->atom_deletewindow, 1);

Then you can create file:
$ sudo nano /usr/share/applications/showtime.desktop
insert

[Desktop Entry]
Name=Showtime
Exec=/usr/bin/showtime
Icon=/usr/share/icons/showtime.png
Terminal=false
Type=Application
Categories=Player
StartupNotify=false
X-Ubuntu-Gettext-Domain=Showtime

save & exit
find suitable icon for dock and:
$ sudo cp icon.png /usr/share/icons/showtime.png
then copy builded binary
$ sudo cp showtime /usr/bin/
$ sudo chmod +x /usr/bin/showtime

And now you can keep icon in dock and lunch showtime without creating another icon in dock
Sorry for my eanglish and report without a patch, but i have a lot of business for now and fix not so big.
Regards.