[gtk+/xi2: 930/1239] Add GdkDevice info to grab broken events.



commit f3417714dcb46da4f77346a604f1f7cc97aa3b64
Author: Carlos Garnacho <carlos lanedo com>
Date:   Sat Aug 29 17:54:59 2009 +0200

    Add GdkDevice info to grab broken events.

 gdk/gdkdisplay.c |   10 ++++++++--
 gdk/gdkevents.h  |    1 +
 2 files changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/gdk/gdkdisplay.c b/gdk/gdkdisplay.c
index 727f48e..cf131bd 100644
--- a/gdk/gdkdisplay.c
+++ b/gdk/gdkdisplay.c
@@ -933,6 +933,7 @@ gdk_set_pointer_hooks (const GdkPointerHooks *new_hooks)
 
 static void
 generate_grab_broken_event (GdkWindow *window,
+                            GdkDevice *device,
 			    gboolean   keyboard,
 			    gboolean   implicit,
 			    GdkWindow *grab_window)
@@ -948,6 +949,7 @@ generate_grab_broken_event (GdkWindow *window,
       event.grab_broken.keyboard = keyboard;
       event.grab_broken.implicit = implicit;
       event.grab_broken.grab_window = grab_window;
+      event.grab_broken.device = device;
       gdk_event_put (&event);
     }
 }
@@ -1257,6 +1259,7 @@ switch_to_pointer_grab (GdkDisplay         *display,
 
 	  if (last_grab->implicit_ungrab)
 	    generate_grab_broken_event (last_grab->window,
+                                        device,
 					FALSE, TRUE,
 					NULL);
 	}
@@ -1310,6 +1313,7 @@ _gdk_display_pointer_grab_update (GdkDisplay *display,
       if (next_grab == NULL ||
 	  current_grab->window != next_grab->window)
 	generate_grab_broken_event (GDK_WINDOW (current_grab->window),
+                                    device,
 				    FALSE, current_grab->implicit,
 				    next_grab? next_grab->window : NULL);
 
@@ -1402,13 +1406,14 @@ _gdk_display_set_has_keyboard_grab (GdkDisplay *display,
   if (display->keyboard_grab.window != NULL &&
       display->keyboard_grab.window != window)
     generate_grab_broken_event (display->keyboard_grab.window,
+                                display->core_pointer, /* FIXME: which event? core pointer not, clearly */
 				TRUE, FALSE, window);
-  
+
   display->keyboard_grab.window = window;
   display->keyboard_grab.native_window = native_window;
   display->keyboard_grab.owner_events = owner_events;
   display->keyboard_grab.serial = serial;
-  display->keyboard_grab.time = time;      
+  display->keyboard_grab.time = time;
 }
 
 void
@@ -1417,6 +1422,7 @@ _gdk_display_unset_has_keyboard_grab (GdkDisplay *display,
 {
   if (implicit)
     generate_grab_broken_event (display->keyboard_grab.window,
+                                display->core_pointer, /* FIXME: which device? core pointer not, clearly */
 				TRUE, FALSE, NULL);
   display->keyboard_grab.window = NULL;  
 }
diff --git a/gdk/gdkevents.h b/gdk/gdkevents.h
index 75b99a0..0095d1b 100644
--- a/gdk/gdkevents.h
+++ b/gdk/gdkevents.h
@@ -477,6 +477,7 @@ struct _GdkEventGrabBroken {
   gboolean keyboard;
   gboolean implicit;
   GdkWindow *grab_window;
+  GdkDevice *device;
 };
 
 /* Event types for DND */



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