Fix slow visual feedback on screenshot service
Fix slow audiovisual feedback on screenshot service
Splits the screenshot service's internal work between two async tasks: capturing, and compressing/writing to disk. The camera flash visual effect and the click sound are now started immediately after capture and run in parallel with PNG compression instead of waiting until the file is complete to start.
This significantly improves perceived latency on high res setups such as 4K, 5K, or dual 4K screens.
For dual 4K I measured save times in excess of 1.25s on old first-generation Core (Nehalem) 2.26 GHz workstation, and expect about 0.5s on more modern high end workstations, still noticeable for keyboard event feedback.
Unredirect disabling is also reduced from the entire time of grab and compression to just during the screen grab, improving performance of 3d games during a screenshot.
Companion patches for gnome-settings-daemon and gnome-screenshot are required to avoid double sound effects:
Note this moves some strings from gnome-settings-daemon.