input-panel: Fix show_input_panel_surface crash when no surface has focus

Signed-off-by: Nicolas Guyomard <nicolas.guyomard@open.eurogiciel.org>
Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
This commit is contained in:
Nicolas Guyomard 2015-10-06 10:40:28 -05:00 committed by Bryce Harrington
parent a151975347
commit 4845354cfa

View File

@ -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;