mirror of
https://gitlab.freedesktop.org/wayland/weston.git
synced 2025-12-20 04:40:07 +01:00
desktop-shell: don't crash input-panel if no kbd focus
If a keyboard exists but it has no current focus, yet something asks the input-panel to come up, we would crash here. Check that there is a focus before attempting to use it. Maybe there should not even exist a case where input-panel tries to come up without a keyboard focus, but I am not sure there is no race where it could happen. In any case, this fix was brought up by the ivi-shell work, where I suppose you can somehow hit it. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Cc: Tanibata, Nobuhiko <ntanibata@jp.adit-jv.com>
This commit is contained in:
parent
ffe9ae7326
commit
a6881ff7fc
1 changed files with 1 additions and 1 deletions
|
|
@ -66,7 +66,7 @@ show_input_panel_surface(struct input_panel_surface *ipsurf)
|
|||
float x, y;
|
||||
|
||||
wl_list_for_each(seat, &shell->compositor->seat_list, link) {
|
||||
if (!seat->keyboard)
|
||||
if (!seat->keyboard || !seat->keyboard->focus)
|
||||
continue;
|
||||
focus = weston_surface_get_main_surface(seat->keyboard->focus);
|
||||
ipsurf->output = focus->output;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue