screenshot: Factor out function
screenshot: Factor out function

No functional changes, but will facilitate future patches.

flatpak/xdg-desktop-portal,flatpak/xdg-desktop-portal,flatpak/xdg-desktop-portal,flatpak/xdg-desktop-portal