Skip to content

WIP: text_input: Clear pending focused surface before setting one on im_destroy

This should solve at least some of #54 (closed) crashes.

However, I don't have a good understanding of that code in the whole context yet.

On handle_im_destroy there's a text_input_set_pending_focused_surface call. It sets a pointer to pending_focused_surface and adds a signal listener. However, unlike other places that function is called in, it doesn't check whether a pending_focused_surface already exists, so the listener on old pending_focused_surface doesn't get unregistered.

I don't fully understand text input stuff yet, so I'm not sure what's the pending_focused_surface, when it's being set etc. Should we call text_input_clear_pending_focused_surface, like I did in this patch, or should we guard calling text_input_set_pending_focused_surface with an if that checks whether pending_focused_surface is NULL?

@dorota.czaplejewicz could you take a look?

Edited by Sebastian Krzyszkowiak

Merge request reports