I found out the reason, but I don't know how to reproduce the bug. Sometimes, metacity failed to recognize depth layer of "nautilus/nemo- background" and normal window, see the following ->
When I get trapped into this bug described above, running "killalll nautilus" under tty1 (Ctrl+F1), then all window except nautilus background can be seen !!!!!!!!!!!!!!!!!!! It seems that metacity thinks nautilus background has higher layer than normal windows. I don't think it's the bug from nautilus, because of the following proof: 1) even replacing nautilus with other similar file explorer like nemo, this bug also happens; 2) when using compiz or older version of metacity, this bug don't happen; So I think there should be some check of source code that is related with the top-level window covering other window. Don't let nautilus background (nemo -n) cover all normal windows. -- You received this bug notification because you are a member of Desktop Packages, which is subscribed to metacity in Ubuntu. https://bugs.launchpad.net/bugs/1538111 Title: untraceable serious bug in metacity 3.18 Status in metacity package in Ubuntu: New Bug description: Ubuntu 16.04 LTS uses 3.18 version of gnome metacity. When doing lots of mess work in Desktop (such as open desktop window, sudo window, dragging window, and so on), "!! WHEN CLICKING CLOSE BUTTON OF A CERTAIN WINDOW !!", there is "small possibility" for metacity to get out of work --> Many windows are disappeared, with only nautilus desktop background and gnome-panel on screen. "Live Window List" still exists in gnome-panel, but no matter doing what (such as open new application from gnome-menu or use Alt+Tab to switch window), none of live windows can be displayed. So the only way is to switch to tty1 using Ctrl+Alt+F1, and executing "DISPLAY=:0 metacity -c --replace", then all windows came back. Till now, I meet this bug every day, but still not sure how to reproduce it bug. I think you should trace what the metacity do when clicking "close button" that makes all windows to be disappeared. Thanks. ProblemType: Bug DistroRelease: Ubuntu 16.04 Package: metacity 1:3.18.1-1ubuntu3 ProcVersionSignature: Ubuntu 4.3.0-7.18-generic 4.3.3 Uname: Linux 4.3.0-7-generic x86_64 ApportVersion: 2.19.3-0ubuntu3 Architecture: amd64 CurrentDesktop: GNOME-Flashback:Unity Date: Tue Jan 26 19:49:48 2016 SourcePackage: metacity UpgradeStatus: No upgrade log present (probably fresh install) To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/metacity/+bug/1538111/+subscriptions -- Mailing list: https://launchpad.net/~desktop-packages Post to : desktop-packages@lists.launchpad.net Unsubscribe : https://launchpad.net/~desktop-packages More help : https://help.launchpad.net/ListHelp