Iconified geometry not respected for some windows under X11.
In X11, panels etc may set the _NET_WM_ICON_GEOMETRY property of a window to tell X where on the screen the window is being minimised to. This allows the window manager to animate minimising and restoring.
I've encountered what seems to be a bug in mutter where this property is not always respected.
Attached is a video demonstrating the problem using an example 'panel' app.
I noticed the bug when I was using the panel program tint2, but I think I've determined that it is not a problem with tint2.
To demonstrate the problem, attached is an example C program which implements a basic 'panel' using raw X11. Compile it with
gcc -o main main.c -lX11 and run. The program displays a window with the names of all windows in a list, and clicking on them toggles whether they are minimised. The program sets the _NET_WM_ICON_GEOMETRY property such that the minimising and restoring animates to the 'panel' in mutter. However, for some windows, un-minimising them results in an animation from the window's upper-left corner instead, rather than from the 'panel'.
This doesn't occur with all windows. A pattern I've seen is that:
- It always occurs with Gnome Terminal, unless one clicks twice quickly such that the window is unminimised before the minimising animation is completed.
- It occurs with Nautilus, Gnome Tweaks, Evince, but only if the mouse moves in between clicking to minimise and clicking to unminimise. If the mouse is held still in between clicks, the unminimise animation is correct.
- It doesn't occur at all with Sublime Text 3 (a GTK2 app) or Inkscape (also GTK2) or Spotify (an Electron app).
Whatever mechanism is being used internally in gnome-shell for this setting does not have a problem, as shell extensions like dashtodock do not have this problem, their minimise/unminimise animations are all correct as far as I can tell.
I see this bug in a fresh install of Ubuntu 18.10. In the video I have dashtodock running too, which could interfere with this sort of thing, but I see the same behaviour whether I remove dashtodock (and also remove Ubuntu's version of) or not.