plugins/screenshot: also take pending focus requests into account

When selecting "active window" in Spectacle, Spectacle closes its window and the active window gets switched to the next window. If that next window is an X11 window, it doesn't become the active window immediately though, it takes until the application responds for that to happen.

To still make the screenshot work, fall back to mostRecentlyActivatedWindow if the active window is nullptr.

BUG: 505202

Merge request reports

Loading