SDL2 calls xdg_toplevel.unset_fullscreen() before the surface is mapped. This causes a segfault in dwl because setfullscreen() expects the surface to be mapped already. Therefore, delay the setfullscreen call until the surface is mapped.
2MNQBTVRKKCIBBLZY42PNL5VS5R62LFYKZ2GMCZM6CEEA6PGEKZQC setfullscreen(c, !c->isfullscreen);
struct wlr_xdg_toplevel_set_fullscreen_event *event = data;if (!c->mon) {/* if the client is not mapped yet, let mapnotify() call setfullscreen() */c->isfullscreen = event->fullscreen;return;}setfullscreen(c, event->fullscreen);