From 1686a9e45bbbc0859f8a52e455e0db3d1d6c991d Mon Sep 17 00:00:00 2001 From: Manuel Stoeckl Date: Thu, 11 Jul 2019 19:36:10 -0400 Subject: [PATCH] Close program when Wayland connection hangs up This change ensures that SuperTuxKart will not keep running in the background when the compositor crashes and doesn't close the STK main window. --- lib/irrlicht/source/Irrlicht/CIrrDeviceWayland.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/irrlicht/source/Irrlicht/CIrrDeviceWayland.cpp b/lib/irrlicht/source/Irrlicht/CIrrDeviceWayland.cpp index 6529a9cc3..64afccf61 100644 --- a/lib/irrlicht/source/Irrlicht/CIrrDeviceWayland.cpp +++ b/lib/irrlicht/source/Irrlicht/CIrrDeviceWayland.cpp @@ -1283,7 +1283,10 @@ bool CIrrDeviceWayland::run() { os::Timer::tick(); - wl_display_dispatch_pending(m_display); + if (wl_display_dispatch_pending(m_display) == -1) + { + closeDevice(); + } for (unsigned int i = 0; i < m_events.size(); i++) {