Only ask application to abort once

This commit is contained in:
Kovid Goyal 2020-06-26 16:28:48 +05:30
parent c7703791d1
commit cf2f8165eb
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

20
glfw/wl_window.c vendored
View File

@ -764,14 +764,18 @@ animateCursorImage(id_type timer_id UNUSED, void *data UNUSED) {
static void static void
abortOnFatalError(int last_error) { abortOnFatalError(int last_error) {
_glfwInputError(GLFW_PLATFORM_ERROR, "Wayland: fatal display error: %s", strerror(last_error)); static bool abort_called = false;
if (_glfw.callbacks.application_close) _glfw.callbacks.application_close(1); if (!abort_called) {
else { abort_called = true;
_GLFWwindow* window = _glfw.windowListHead; _glfwInputError(GLFW_PLATFORM_ERROR, "Wayland: fatal display error: %s", strerror(last_error));
while (window) if (_glfw.callbacks.application_close) _glfw.callbacks.application_close(1);
{ else {
_glfwInputWindowCloseRequest(window); _GLFWwindow* window = _glfw.windowListHead;
window = window->next; while (window)
{
_glfwInputWindowCloseRequest(window);
window = window->next;
}
} }
} }
// ensure the tick callback is called // ensure the tick callback is called