Fixes up
e530f43.
When IME (e.g. fcitx5) is killed, relay->input_method is destroyed and
then relay->input_method->keyboard_grab is destroyed, which causes null
pointer dereference and crashes labwc.
Possible solutions are:
- Let wlroots keep emitting keyboard grab as `data` from keyboard grab's
destroy handler just like before
- Let wlroots destroy keyboard grab before input method
- Let compositor store keyboard grab as relay->keyboard_grab
But let's just revert the change in
e530f43 for now.
{
struct input_method_relay *relay =
wl_container_of(listener, relay, keyboard_grab_destroy);
- struct wlr_input_method_keyboard_grab_v2 *keyboard_grab =
- relay->input_method->keyboard_grab;
+ struct wlr_input_method_keyboard_grab_v2 *keyboard_grab = data;
+ assert(keyboard_grab);
wl_list_remove(&relay->keyboard_grab_destroy.link);