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
This commit is contained in:
Emmanuele Bassi 2013-09-20 10:54:46 +01:00
parent c03f7727f7
commit 300c76df17

View File

@ -774,7 +774,10 @@ clutter_device_manager_xi2_translate_event (ClutterEventTranslator *translator,
event->any.stage = stage; 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) switch (xi_event->evtype)
{ {