Skip to content

Fix xwayland restart... and add wlr_seat destroy listener.

Dominique Martinet requested to merge github/fork/martinetd/xwm_fixes into master

This started as a "simple" kludge to restore rootston hooks when xwayland restarts, I'm still not quite happy with that part so comments more than welcome: basically, I'm just copying over listeners as a list + seat from old struct to new struct and it's not very pretty and quite fragile. I think there needs to be some work to have a wlr_xwayland_reinit() function instead of using init() that doesn't memset(0) the whole struct as blindly as I used to do. Happy to do that either in this PR or in another one. Done here.

The rest is quite good though:

  • some small xwm leak (there's tons left when I switch VT, but it's hard to tell where it comes from)
  • on restart, the shutdown happens in a different order to shutdown was completly broken, so added an event for when wlr_seat destroys itself that others can listen on.
  • Rootston apparently needed that event too because I kept crashing on shutdown after adding that event.

At this point, this works with no crash for me, so test plan:

  • start some Xwaylands stuff / wayland stuff
  • pkill Xwayland, Xwayland windows die (make sure there's been at least 5s since start or previous pkill)
  • start some new Xwayland window, they should appear (didn't previously, the last time this worked was on example compositor pre-rootston)
  • shutdown rootston, this shouldn't crash either.

Merge request reports

Loading