Comment 6 for bug 1724250

Revision history for this message
Egmont Koblinger (egmont-gmail) wrote :

Let's make it clear that it's absolutely most definitely not a bug in gnome-terminal. Gnome-terminal uses old-fashioned server-side decorations, that is, the window border is drawn by the window manager. There is no way gnome-terminal could legally ask it to draw something else there.

The picture there looks like part of a terminal icon, the one that's shown e.g. in gnome-terminal's About dialog in 128x128. The misdrawn one also seems to be of this size, however, scaled up from a lower resolution.

The only way I can reasonably think of where the window manager takes this icon from is the _NET_WM_ICON window property, as shown e.g. by the xprop command. After you click on the desired window, by default it prints a low-res variant of the picture to the terminal.

The output of "xprop -notype 32c _NET_WM_ICON" consists of two numbers: the dimension, followed by that many numbers in the natural order, each number encoding one pixel. E.g. for me the first two numbers are 32, 32, and then the next 32^2 = 1024 numbers encode the icon in its smallest size. Then it's followed by the same at size 48x48 (so far this corresponds to the parameterless xprop command showing these two sizes). and then it even starts printing at size 256x256 but the output stops prematurely.

Look at e.g. https://unix.stackexchange.com/questions/48860/how-to-dump-the-icon-of-a-running-x-program for how to convert these numbers to .pam format. Then forget pamrgbatopng mentioned on that site, use imagemagic's "convert" to convert to let's say .png.

gnome-terminal's source has a "gtk_window_set_default_icon_name (GNOME_TERMINAL_ICON_NAME)", the latter constant being defined as "utilities-terminal". A bit of strace'ing reveals that the About dialog takes the picture from the Humanity theme.

Putting together the pieces we have so far: gnome-terminal installs _NET_WM_ICON via the gtk_window_set_default_icon_name call, taking the files /usr/share/icons/Humanity/apps/[size]/utilities-terminal.svg, at sizes 32, 48, maybe 128, maybe 256; not sure if 256 fails now or when querying, not sure whose fault that chopped output is, not sure if it's relevant to our bug.

The picture incorrectly shown indeed suspiciously looks like Humanity's utilities-terminal icon scaled up from 48 to 128.

The question is... Why does the window manager decide to even try to show the icon, and why does it fail to properly do so...???