xwayland: minor fixups for stability (#8323)

* xwayland: add inline safe closing of fds and fix LOCK_FILE_MODE permissions

* xwayland: auto recreate xwayland instance if it crashes

* xwayland: delay auto-restart until later
This commit is contained in:
trianta
2024-11-03 08:59:46 -06:00
committed by GitHub
parent 514e0ff509
commit 5833abbbd1
2 changed files with 16 additions and 12 deletions

View File

@@ -13,6 +13,7 @@
#include "../defines.hpp"
#include "../Compositor.hpp"
#include "../protocols/core/Seat.hpp"
#include "../managers/eventLoop/EventLoopManager.hpp"
#include "../managers/SeatManager.hpp"
#include "../protocols/XWaylandShell.hpp"
#include "../protocols/core/Compositor.hpp"
@@ -691,6 +692,8 @@ int CXWM::onEvent(int fd, uint32_t mask) {
Debug::log(CRIT, "XWayland has yeeten the xwm off?!");
g_pXWayland->pWM.reset();
g_pXWayland->pServer.reset();
// Attempt to create fresh instance
g_pEventLoopManager->doLater([]() { g_pXWayland = std::make_unique<CXWayland>(true); });
return 0;
}