[Spice-devel] [spice-gtk v1] widget: check if widget is realized before gdk_set_grab()

Victor Toso victortoso at redhat.com
Wed Mar 8 07:55:01 UTC 2017


Hi,

On Mon, Mar 06, 2017 at 03:29:14PM +0100, Victor Toso wrote:
> From: Victor Toso <me at victortoso.com>
> 
> gdk_seat_grab() expects that the widget is visible otherwise it will
> always fail with GDK_GRAB_NOT_VIEWABLE. This means that we can check if
> display is realized before running gdk_seat_grab().
> 
> Fixes a critical & warning introduced by 3f4c5bcc88ca5db125e
> 
>  > Gdk-CRITICAL **: Window 0x17dcca0 has not been made visible in
>  > GdkSeatGrabPrepareFunc
>  > GSpice-WARNING **: keyboard grab failed 3
> 
> Signed-off-by: Victor Toso <victortoso at redhat.com>

I sent this because I thought it would be a harmless warning due the api
change but it could also be a symptom for something broken somewhere.

Self nack for now.

> ---
>  src/spice-widget.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/src/spice-widget.c b/src/spice-widget.c
> index 9a7ea56..ff9c7d2 100644
> --- a/src/spice-widget.c
> +++ b/src/spice-widget.c
> @@ -856,6 +856,8 @@ static void try_keyboard_grab(SpiceDisplay *display)
>          return;
>      if (d->keyboard_grab_released)
>          return;
> +    if (!gtk_widget_get_realized(GTK_WIDGET(display)))
> +        return;
>  
>      g_return_if_fail(gtk_widget_is_focus(widget));
>  
> -- 
> 2.9.3
> 
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/spice-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20170308/89996ad7/attachment.sig>


More information about the Spice-devel mailing list