
The screenshot code has a fair bit of nested callbacks, which means that it is a good use case for async functions and Promises. Most code uses GIO's async pattern, which means it can be easily turned into promises with Gio._promisify(); first handle the couple of cases that need custom code though, starting with SelectArea. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/903