pinnacle icon indicating copy to clipboard operation
pinnacle copied to clipboard

Restart xwayland if it crashes

Open Ottatop opened this issue 1 year ago • 3 comments

Currently if xwayland crashes or exits by someone killing the Xwayland process then xwayland is just dead. Ideally we'd attempt a restart, but that creates a problem: restarting the xwayland server will increment DISPLAY by 1. It should be easy to send a message to a config to get it to set the new DISPLAY, but any already open applications can't get the updated DISPLAY. Unsure of how to deal with that.

Ottatop avatar Mar 30 '24 23:03 Ottatop

when Xserver crashes, 95% apps using it get a signal and go away. So it's not really a problem (usually). if you take a few seconds before restart then the DISPLAY may not increase.

ildar avatar Mar 31 '24 09:03 ildar

when Xserver crashes, 95% apps using it get a signal and go away. So it's not really a problem (usually).

Did not know that. I was thinking more Wayland applications that could spawn xwayland ones that are already open, like terminals. Though I guess there isn't really a way to update their environment variables.

if you take a few seconds before restart then the DISPLAY may not increase.

Interesting, I'll try that out once I get around to implementing this issue. If it works then the above doesn't need worrying about.

Ottatop avatar Mar 31 '24 22:03 Ottatop

Looking at Smithay, not changing the DISPLAY should be doable. You can specify a DISPLAY to use when starting xwayland, so forcing re-use of the same value isn't an issue. If the locking "just works" (i.e. is automatically released when xwayland crashes), then just restarting xwayland with the fixed display on crash (or retrying if it fails to start) should be enough already.

I might give implementing this a shot, if/when I find time.

LogicalOverflow avatar Apr 11 '24 19:04 LogicalOverflow