xwayland: Improve checks for confined_to on InputOnly windows

In this pretty Wine/Proton specific kludge, we try to handle confining grabs
on InputOnly windows by trying to find the InputOutput window that the pointer
would get visually confined to.

The grabbing window and the visible window come from different clients, so
we used to simply resort to the pointer focus. This is troublesome though, as
the call may happen very soon at a time that the toplevel wasn't yet mapped by
the Wayland compositor, so the pointer focus may well be out of date soon.

In these situations, it does seem that even though the confining grab happens
too early to have the wayland surface mapped. The xserver view of the WindowPtr
does already reflect the size, so use this to find out the better window to
assign the confining grab to, one whose geometry fully contains the InputOnly
window's.

Signed-off-by: Carlos Garnacho <carlosg@gnome.org>
Reviewed-by: Olivier Fourdan <ofourdan@redhat.com>
4 jobs for locking-fixes in 4 minutes and 54 seconds
Status Job ID Name Coverage
  Docker Image
passed #2643378
debian-testing

00:00:27

 
  Build And Test
passed #2643379
autotools

00:04:26

passed #2643380
meson

00:01:07

passed #2643381
meson-noglamor

00:01:01