And another update: I have occasionally fixed that by reenabling desktop icons.
I have previously used Ubuntu Tweak to disable icons on desktop. Apparently this removes some kind of root nautilus window (which also draws the background BTW). It looks like Compiz expects this window to exist, and if it does not exist and all other windows are minimized then Compiz goes crazy.
To fix the missing desktop background I have reset this option to the original state, now Nautilus draws background and icons, and I can safely minimize all windows.
And another update: I have occasionally fixed that by reenabling desktop icons.
I have previously used Ubuntu Tweak to disable icons on desktop. Apparently this removes some kind of root nautilus window (which also draws the background BTW). It looks like Compiz expects this window to exist, and if it does not exist and all other windows are minimized then Compiz goes crazy.
To fix the missing desktop background I have reset this option to the original state, now Nautilus draws background and icons, and I can safely minimize all windows.