[clutter/clutter-1.16] x11: Ensure we have a stage before accessing its fields



commit 300c76df17a8508e564821ff3a27cb81ae7e5b23
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Fri Sep 20 10:54:46 2013 +0100

    x11: Ensure we have a stage before accessing its fields
    
    For some XI2 we do not have a Stage associated to the event window.
    
    Original patch by: Giovanni Campagna <scampa giovanni gmail com>
    Signed-off-by: Emmanuele Bassi <ebassi gnome org>
    
    https://bugzilla.gnome.org/show_bug.cgi?id=708439

 clutter/x11/clutter-device-manager-xi2.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/clutter/x11/clutter-device-manager-xi2.c b/clutter/x11/clutter-device-manager-xi2.c
index 8f9133f..701f73e 100644
--- a/clutter/x11/clutter-device-manager-xi2.c
+++ b/clutter/x11/clutter-device-manager-xi2.c
@@ -774,7 +774,10 @@ clutter_device_manager_xi2_translate_event (ClutterEventTranslator *translator,
 
   event->any.stage = stage;
 
-  window_scale = stage_x11->scale_factor;
+  if (stage_x11 != NULL)
+    window_scale = stage_x11->scale_factor;
+  else
+    window_scale = 1;
 
   switch (xi_event->evtype)
     {


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