Screenshot "flash" effect is delayed at very high resolutions
I have a workstation with an older 2.26 GHz many-core CPU and a modern graphics card with dual 4K displays. When hitting the printscreen key to take a screenshot, it can take a full second or more before the visual-feedback "flash" effect happens, which as a user "feels" like it's taking a long time to respond to my keypress.
Doing some profiling, I found that most of that time is spent in compressing the 7680x2160 PNG image. Even on a top of the line current CPU I estimate it would take >0.5s to save a screenshot of this size.
On checking gnome-shell's source, it looks like the flash doesn't fire until after the PNG is completely written to disk and the result data is available.
I propose adding another callback to the screenshot service methods, fired after the pixbuf fetching and before the compression starts. The JS side can use this to start the flash effect, which will then run in parallel with the compression -- the final notification bits then fire when compression & writing to disk are complete.
This should make the whole operation feel a lot faster to the user even in cases where it takes a large fraction of a second to compress the PNG.
If there's no objection, I'm going to try a proof of concept patch if I can get my build setup working. :D
Test setup:
- Fedora 28
- GNOME 3.28.3
- NVIDIA proprietary X11 drivers (boo) for GTX 1060
- 2x 3840x2160 displays at 200% scaling