[gtk+/multitouch: 103/121] gtk,range: Don't perform a GTK+ grab
- From: Carlos Garnacho <carlosg src gnome org>
 
- To: commits-list gnome org
 
- Cc: 
 
- Subject: [gtk+/multitouch: 103/121] gtk,range: Don't perform a GTK+ grab
 
- Date: Thu, 12 Jan 2012 03:14:13 +0000 (UTC)
 
commit cd1bd3a3e9cb84dfedb282d799554bb72e82a047
Author: Carlos Garnacho <carlosg gnome org>
Date:   Thu Jan 5 00:27:57 2012 +0100
    gtk,range: Don't perform a GTK+ grab
    
    The implicit grab on priv->event_window already warrants that this
    widget is the only one getting events while the button is pressed,
    so don't spare the GTK+ grab here.
 gtk/gtkrange.c |   14 +++++---------
 1 files changed, 5 insertions(+), 9 deletions(-)
---
diff --git a/gtk/gtkrange.c b/gtk/gtkrange.c
index ac9bf22..391acc2 100644
--- a/gtk/gtkrange.c
+++ b/gtk/gtkrange.c
@@ -2340,15 +2340,11 @@ range_grab_add (GtkRange      *range,
   if (device == priv->grab_device)
     return;
 
-  if (priv->grab_device != NULL)
-    {
-      g_warning ("GtkRange already had a grab device, releasing device grab");
-      gtk_device_grab_remove (GTK_WIDGET (range), priv->grab_device);
-    }
-
-  /* we don't actually gdk_grab, since a button is down */
-  gtk_device_grab_add (GTK_WIDGET (range), device, TRUE);
-
+  /* Don't perform any GDK/GTK+ grab here. Since a button
+   * is down, there's an ongoing implicit grab on
+   * priv->event_window, which pretty much guarantees this
+   * is the only widget receiving the pointer events.
+   */
   priv->grab_location = location;
   priv->grab_button = button;
   priv->grab_device = device;
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]