qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v2 1/4] gtk: Use gtk generic event signal instea


From: Cole Robinson
Subject: Re: [Qemu-devel] [PATCH v2 1/4] gtk: Use gtk generic event signal instead of motion-notify-event
Date: Wed, 02 Apr 2014 09:25:07 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0

On 04/02/2014 08:32 AM, Takashi Iwai wrote:
> The GDK motion-notify-event isn't generated when the pointer goes out
> of the target window even if the pointer is grabbed, which essentially
> means to lose the pointer tracking in gtk-ui.
> 
> Meanwhile the generic "event" signal is sent when the pointer is
> grabbed, so we can use this and pick the motion notify events manually
> there instead.
> 
> Reference: https://bugzilla.novell.com/show_bug.cgi?id=849587
> Signed-off-by: Takashi Iwai <address@hidden>
> ---
>  ui/gtk.c | 11 +++++++++--
>  1 file changed, 9 insertions(+), 2 deletions(-)
> 
> diff --git a/ui/gtk.c b/ui/gtk.c
> index f056e4034b3e..54b835428a28 100644
> --- a/ui/gtk.c
> +++ b/ui/gtk.c
> @@ -765,6 +765,13 @@ static gboolean gd_key_event(GtkWidget *widget, 
> GdkEventKey *key, void *opaque)
>      return TRUE;
>  }
>  
> +static gboolean gd_event(GtkWidget *widget, GdkEvent *event, void *opaque)
> +{
> +    if (event->type == GDK_MOTION_NOTIFY)
> +        return gd_motion_event(widget, &event->motion, opaque);
> +    return FALSE;
> +}
> +
>  /** Window Menu Actions **/
>  
>  static void gd_menu_pause(GtkMenuItem *item, void *opaque)
> @@ -1267,8 +1274,8 @@ static void gd_connect_signals(GtkDisplayState *s)
>      g_signal_connect(s->drawing_area, "expose-event",
>                       G_CALLBACK(gd_expose_event), s);
>  #endif
> -    g_signal_connect(s->drawing_area, "motion-notify-event",
> -                     G_CALLBACK(gd_motion_event), s);
> +    g_signal_connect(s->drawing_area, "event",
> +                     G_CALLBACK(gd_event), s);
>      g_signal_connect(s->drawing_area, "button-press-event",
>                       G_CALLBACK(gd_button_event), s);
>      g_signal_connect(s->drawing_area, "button-release-event",
> 

Tested-by: Cole Robinson <address@hidden>
Reviewed-by: Cole Robinson <address@hidden>

Thanks,
Cole



reply via email to

[Prev in Thread] Current Thread [Next in Thread]