From 4845354cfad33dbc6ef5c3bd3c1d3757a0522088 Mon Sep 17 00:00:00 2001 From: Nicolas Guyomard Date: Tue, 6 Oct 2015 10:40:28 -0500 Subject: [PATCH] input-panel: Fix show_input_panel_surface crash when no surface has focus Signed-off-by: Nicolas Guyomard Signed-off-by: Derek Foreman Reviewed-by: Bryce Harrington --- desktop-shell/input-panel.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/desktop-shell/input-panel.c b/desktop-shell/input-panel.c index 251d0449..95d62873 100644 --- a/desktop-shell/input-panel.c +++ b/desktop-shell/input-panel.c @@ -74,6 +74,8 @@ show_input_panel_surface(struct input_panel_surface *ipsurf) if (!keyboard || !keyboard->focus) continue; focus = weston_surface_get_main_surface(keyboard->focus); + if (!focus) + continue; ipsurf->output = focus->output; x = ipsurf->output->x + (ipsurf->output->width - ipsurf->surface->width) / 2; y = ipsurf->output->y + ipsurf->output->height - ipsurf->surface->height;