gnome-terminal graphic artifact

Bug #1724250 reported by Simone Bordet
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
gnome-shell (Ubuntu)
New
Undecided
Unassigned
gnome-terminal (Ubuntu)
Confirmed
Undecided
Unassigned
humanity-icon-theme (Ubuntu)
New
Undecided
Unassigned
mutter (Ubuntu)
New
Undecided
Unassigned

Bug Description

Opening gnome-terminal in Ubuntu 17.10 shows the terminal window with a graphic artifact on the right of the title bar, where the window buttons to minimize, maximize and close are.

The window buttons are working so this is just a visual glitch and does not otherwise affect gnome-terminal functionalities.

It does not matter whether the gnome-terminal window is maximized or not, the graphic artifact is always present and does not disappear hovering on it with the mouse.

Other applications do not appear to be affected, only gnome-terminal.

I'm using NVIDIA Corporation GM204M [GeForce GTX 970M] with the NVIDIA binary driver 384.90.

See attached screenshot.

ProblemType: Bug
DistroRelease: Ubuntu 17.10
Package: gnome-terminal 3.24.2-0ubuntu4
ProcVersionSignature: Ubuntu 4.13.0-16.19-generic 4.13.4
Uname: Linux 4.13.0-16-generic x86_64
NonfreeKernelModules: nvidia_uvm nvidia_drm nvidia_modeset nvidia
ApportVersion: 2.20.7-0ubuntu3
Architecture: amd64
CurrentDesktop: ubuntu:GNOME
Date: Tue Oct 17 15:37:42 2017
InstallationDate: Installed on 2017-10-01 (15 days ago)
InstallationMedia: Ubuntu 17.10 "Artful Aardvark" - Alpha amd64 (20170926)
SourcePackage: gnome-terminal
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Simone Bordet (simone-bordet) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in gnome-terminal (Ubuntu):
status: New → Confirmed
Revision history for this message
Kim Phillips (kim-phillips-o) wrote :

exactly the same problem: it seems that the graphic file that is supposed to represent the terminal icon is not referencing the file with the right graphic for terminal? Note: vanilla 4.13.12 kernel, with NVIDIA Corporation GK107GL [Quadro K600] and the nvidia-387 driver.

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

Another report of the same issue: https://askubuntu.com/questions/983629/terminal-window-stuck-with-the-corner-of-another-window-drawn-on-it

It's interesting that you have 4 buttons instead of 3 (and it's the same at that other report).

Did you somehow add a 4th button? What and how exactly? Or does it only appear in gnome-terminal? What do those buttons do if you click on them?

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

Does this also happen on other windows of gnome-terminal (e.g. Search->Find, Edit->Preferences, Edit->Profile Preferences, Help->About)?

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...???

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

The same bug is also reported at lp:1712660.

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

Yet another report of this bug, with further precious details and a screenshot revealing that the misdrawn icon is bigger than 128, maybe 140 or 144 or so pixels large:

https://bugzilla.gnome.org/show_bug.cgi?id=787470

Revision history for this message
Michael Vescovo (mvescovo) wrote :

I'm not sure how to reply to individual comments but to add to comment #4, I am the person who reported this on askubuntu and the 4th button is the menu button. I use Gnome Tweaks and have "Application Menu" turned off under the "Top Bar" settings. I'm not on my work machine now so I can't see what happens if I turn it back on or uninstall Gnome Tweaks. I'll try it next week and report back. Having said that, I also use Gnome Tweaks at home and don't see the issue here.

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

Michael, thanks, now I know how to get that fourth button. For me, a small "terminal" icon appears there as expected.

In your askubuntu post the buttons are on the right, and _assuming_ that the incorrectly sized icon's top left corner is placed at the desired location, it _seems_ that the window manager intends to display 4(!) rounded buttons and then as the 5th (from the right) the terminal icon.

In the screenshot from comment 8 the buttons are on the left, and it seems to disprove this assumption. The relative offset of the 4th rounded button and the giant icon is exactly (pixel-wise) the same in the two cases.

However, this sounds so weird to me, because then in order to have this faulty behavior, there would need to be 3 underlying issues:

- Incorrectly scale the icon;
- Not use the top left corner, but another reference point (maybe 1px to the right - off by one bug?) as the fixed point of scaling;
- Show a rounded button behind the icon for no apparent reason.

Do you have all Artful updates installed? I'm just wondering if maybe an updated package has already fixed this issue.

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

So for a second I missed the fact that according to the GNOME bugreport, this bug is only present in Xorg, not in Wayland. (Michael, can this be the difference between your two computers?)

For me, the behavior with the "Ubuntu on Xorg" choice when logging in is:

The terminal icon is shown as the 4th button, using the correct size. However, behind it there's a round button.

This round button behind the icon isn't there in Wayland, and isn't there in Xorg with CSD apps [client-side decoration] either. I suddenly couldn't find any other SSD app [server-side decoration] with appmenu that I could check.

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

I can reproduce the problem with plenty of other names taken from the Humanity theme, such as "clock" or "gnome-panel-force-quit" instead of gnome-terminal's default "utilities-terminal".

The culprit really seems to be gnome-shell/mutter, or some library used by them.

So far I could only reproduce the problem with the Humanity icon theme, although I haven't really tried other themes (only Adwaita a bit). It could even be that the icon theme ships something wrong.

The problem is present both with the "Ubuntu on Xorg" (Ubuntu flavor of gnome-shell experience) as well as "GNOME on Xorg" (default GNOME experience), provided that I switch the latter using gnome-tweak-tool to use the Humanity icon theme.

Revision history for this message
Mike Forsberg (bigmike-f) wrote :

I see the same thing. Is there a way to re-initialize to fix the icons?

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. This particular bug has already been reported and is a duplicate of bug 1718238, so it is being marked as such. Please look at the other bug report to see if there is any missing information that you can provide, or to see if there is a workaround for the bug. Additionally, any further discussion regarding the bug should occur in the other report. Feel free to continue to report any other bugs you may find.

Revision history for this message
Michael Vescovo (mvescovo) wrote :

ok I can confirm that from my work machine turning the "application menu" on from gnome tweak tool fixes it. If I turn it off the artefact shows up again. It happens in real time as I toggle the switch.

If I type "echo $XDG_SESSION_TYPE" it says x11. Not sure about my home machine. I'll have to report back.

Revision history for this message
Michael Vescovo (mvescovo) wrote :

ok so my home machine says wayland and does not have the problem. So maybe something with x11.

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

Thanks, it's pretty clear now that the bug is present on X11 only.

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

Investigation continuing in bug #1718238...

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.