spice-widget: Fix auto-grab on window size change
spice-widget: Fix auto-grab on window size change

Commit 8a7e72e3 "widget: regrab when widget is reconfigured" adds an
ungrab + grab call to the configure event handling code. But it does this
without checking if the mouse is grabbed at all, causing an unsolicited
grab in certain scenarios, ie:

1) User boots a vm
2) Connects with remote-viewer
3) Goes and do some web-browsing while the vm boots
4) Mouse happens to hover over the remote-viewer window
5) Guests changes resolution (ie X starts)
6) The mouse is grabbed, and when the user tries to move it to
   click something in his web-browser this does not work.

This patch fixes this by checking that the mouse is grabbed before doing
the ungrab + re-grab which is needed to reconfigure the grab to the new window
size / location.

Signed-off-by: Hans de Goede <9fa1be1a5b5729e4c6b404f34c9ce49ff4882fd8@redhat.com>

Fantu/spice-gtk,fgouget/spice-gtk,guodong/spice-gtk,elmarco/spice-gtk,Fantu/spice-gtk,Fantu/spice-gtk,freedesktop-unofficial-mirror/spice__spice-gtk,elmarco/spice-gtk,fgouget/spice-gtk,elmarco/spice-gtk,freedesktop-unofficial-mirror/spice__spice-gtk,SPICE/spice-gtk,guodong/spice-gtk,SPICE/spice-gtk,guodong/spice-gtk,flexVDI/spice-gtk,guodong/spice-gtk,SPICE/spice-gtk,Fantu/spice-gtk,freedesktop-unofficial-mirror/spice__spice-gtk,fgouget/spice-gtk,flexVDI/spice-gtk,freedesktop-unofficial-mirror/spice__spice-gtk,SPICE/spice-gtk,elmarco/spice-gtk