You can try to replace the implementation of WindowImplX11::setIcon with this one:
std::vector<Uint32> icon(2 + width * height);
icon[0] = width;
icon[1] = height;
for (std::size_t i = 0; i < width * height; ++i)
icon[i + 2] = (pixels[i * 4 + 3] << 24) | (pixels[i * 4 + 1] << 16) | (pixels[i * 4 + 2] << 8) | pixels[i * 4 + 3];
Atom iconAtom = XInternAtom(m_display, "_NET_WM_ICON", False);
Atom cardinalAtom = XInternAtom(m_display, "CARDINAL", False);
XChangeProperty(m_display, m_window, iconAtom, cardinalAtom, 32, PropModeReplace, reinterpret_cast<unsigned char*>(icon.data()), icon.size());
XFlush(m_display);
This code may not work or even not compile, so I let you check for stupid (or other) errors ;)
Xfce is ok(see attachment).
Icon was this as png loaded with sf::Image : http://www.cafebink.com/wp-content/uploads/2013/01/mug_of_beer-7581.jpg
Nope, I did not resize. 1600x1200 icons all the way. 8)
Maybe it's your virtualiztion software messing it up?
I can try install some other DE (or two or three) and see if it runs ok too.
int main()
{
sf::RenderWindow app(sf::VideoMode(640,480),"hehe");
sf::Image img;
img.loadFromFile("/home/frex/NetBeansProjects/resources/beer.png");
app.setIcon(img.getSize().x,img.getSize().y,img.getPixelsPtr());
while(app.isOpen())
{
sf::Event eve;
while(app.pollEvent(eve)) if(eve.type==sf::Event::Closed) app.close();
app.clear();
app.display();
}
}
Of course I'm not going to install Ubuntu over my beloved Fedora from my beloved Red Hat. ;)