[gtk+] x11: Skip GenericEvents with no cookie data in the xi2 device	manager
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc: 
- Subject: [gtk+] x11: Skip GenericEvents with no cookie data in the xi2 device	manager
- Date: Fri, 15 Jul 2011 16:39:17 +0000 (UTC)
commit b5f30143ed9cd26ef7a65003265b8a8c45c1c95b
Author: Carlos Garnacho <carlosg gnome org>
Date:   Fri Jul 15 18:33:44 2011 +0200
    x11: Skip GenericEvents with no cookie data in the xi2 device manager
    
    https://bugzilla.gnome.org/show_bug.cgi?id=653947
    
    It could happen that a cookie event has been already allocated/freed
    in an event filter, as it can't be allocated a second time, all GDK
    can do is skipping the event. Spotted by Guillaume Desmottes.
 gdk/x11/gdkdevicemanager-xi2.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/gdk/x11/gdkdevicemanager-xi2.c b/gdk/x11/gdkdevicemanager-xi2.c
index 5bd5500..425efee 100644
--- a/gdk/x11/gdkdevicemanager-xi2.c
+++ b/gdk/x11/gdkdevicemanager-xi2.c
@@ -1025,6 +1025,9 @@ gdk_x11_device_manager_xi2_translate_event (GdkEventTranslator *translator,
 
   ev = (XIEvent *) cookie->data;
 
+  if (!ev)
+    return FALSE;
+
   window = get_event_window (translator, ev);
 
   if (window && GDK_WINDOW_DESTROYED (window))
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]