Commit db86ec81 authored by Dorota Czaplejewicz's avatar Dorota Czaplejewicz
Browse files

Don't let dead widgets be clicked

Fixes crash when a widget would be free'd but a click event would still try to access it.

Partially fixes #18
parent 1402c86b
Pipeline #2420 passed with stage
in 49 seconds
......@@ -972,6 +972,10 @@ button_handler(struct widget *widget, struct input *input, uint32_t time,
}
}
if (!keyboard->window) {
return;
}
struct size size = keyboard_get_size(keyboard);
window_schedule_resize(keyboard->window, size.width, size.height);
widget_schedule_redraw(widget);
......@@ -1012,6 +1016,10 @@ touch_handler(struct input *input, uint32_t time,
}
}
if (!keyboard->window) {
return;
}
struct size size = keyboard_get_size(keyboard);
window_schedule_resize(keyboard->window, size.width, size.height);
widget_schedule_redraw(keyboard->widget);
......
......@@ -1729,6 +1729,9 @@ widget_destroy(struct widget *widget)
wl_list_for_each(input, &display->input_list, link) {
if (input->focus_widget == widget)
input->focus_widget = NULL;
if (input->grab == widget) {
input->grab = NULL;
}
}
wl_list_remove(&widget->link);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment