From 2f90e355310801f78a1be48515c8cf740f3291af Mon Sep 17 00:00:00 2001 From: Giovanni Campagna Date: Fri, 20 Sep 2013 10:24:42 +0200 Subject: [PATCH] clutter-xi2: don't access the stage if we don't have one For DeviceChanged and HierarchyChanged events we don't have the stage, so we can't access the scale factor on it. Fixes hotplugging of devices which would happen when switching VTs. https://bugzilla.gnome.org/show_bug.cgi?id=708439 --- clutter/x11/clutter-device-manager-xi2.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/clutter/x11/clutter-device-manager-xi2.c b/clutter/x11/clutter-device-manager-xi2.c index 8f9133f..67f4ce5 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) + window_scale = stage_x11->scale_factor; + else + window_scale = 0; switch (xi_event->evtype) { -- 1.8.3.1