Merge request: weston_desktop_surface_set_size causes a segfault on xwayland desktop_surface that is going to be destroyed
Calling weston_desktop_surface_set_size with as argument a desktop_surface that corresponds to a xwayland window that does not exist any more, but that has not yet been notified as destroyed by the surface_removed callback, causes a segmentation fault in the module xwayland.so.
The simplest way to reproduce the bug is to run a X terminal application in weston. Type in it something like :
sleep 5; exit
then keep on resizing the window with the mouse. When the terminal closes, weston crashes. Alternatively, in the surface_removed callback, you can set the size of all the existing windows (not yet notified as destroyed by the surface_removed callback). Then run any X application that closes two windows at a time (e.g., a dialog in an editor asking if you want to quit without saving).