From 47e2d6da70f3bd28b3f5d868cbc695e78e20795d Mon Sep 17 00:00:00 2001 From: Janos Kovacs Date: Sat, 18 Jan 2014 15:11:38 +0200 Subject: ico-input.mgr: avoid crashes in case the assigned app were not running If system-controller directs some input to an application that does not run and the input state changed, weston crashes in ico_device_input_event() routine. This patch fixes this problem by avoiding to deliver input state changes to applications that did not run or have not registered yet a proxy. Change-Id: I87405ad91a0149180675fd512d54b413a4907409 Signed-off-by: Janos Kovacs --- src/ico_input_mgr.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/ico_input_mgr.c b/src/ico_input_mgr.c index b24fbed..0ff284b 100644 --- a/src/ico_input_mgr.c +++ b/src/ico_input_mgr.c @@ -1441,6 +1441,14 @@ ico_device_input_event(struct wl_client *client, struct wl_resource *resource, return; } + if (! pInput->app->resource) { + uifw_trace("ico_device_input_event: Leave(%s.%s assigned App.%s " + "is not running or not interested)", + pIctlMgr->device, pInput->swname, pInput->app->appid); + return; + } + + /* send event to application */ uifw_trace("ico_device_input_event: send event=%s.%s[%d],%d,%d to App.%s", pIctlMgr->device, pInput->swname, input, code, state, pInput->app->appid); -- cgit v1.2.3