[gtk+/xi2] gtkmain.c: Don't add grab is widget is already grab widget.



commit b6139b7696067302ef919cecd6db8267edd883e8
Author: Carlos Garnacho <carlosg gnome org>
Date:   Tue Mar 9 18:17:54 2010 +0100

    gtkmain.c: Don't add grab is widget is already grab widget.
    
    gtk_device_grab_add() is now unable to add several consecutive
    grabs on the same widget.

 gtk/gtkmain.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkmain.c b/gtk/gtkmain.c
index 11909ad..5e5eaaf 100644
--- a/gtk/gtkmain.c
+++ b/gtk/gtkmain.c
@@ -1998,7 +1998,9 @@ gtk_device_grab_add (GtkWidget        *widget,
 
   group = gtk_main_get_window_group (widget);
   old_grab_widget = gtk_window_group_get_current_device_grab (group, device);
-  _gtk_window_group_add_device_grab (group, widget, device, block_others);
+
+  if (old_grab_widget != widget)
+    _gtk_window_group_add_device_grab (group, widget, device, block_others);
 
   gtk_grab_notify (group, device, old_grab_widget, widget, TRUE);
 }



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