From 129a5ccb197f6a3c6907f46892c4abdc41b14303 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Camilla=20L=C3=B6wy?= Date: Wed, 6 Nov 2019 23:34:08 +0100 Subject: [PATCH] Cocoa: Process events after window destruction On macOS a destroyed window remained on screen until the next time events were processed. This makes the behavior more consistent with other platforms. Fixes #1412. (cherry picked from commit c819f27ce3e6639b4d4b432c0e5191e5c26a9d31) --- README.md | 2 ++ src/cocoa_window.m | 3 +++ 2 files changed, 5 insertions(+) diff --git a/README.md b/README.md index 77844aaf..9572d585 100644 --- a/README.md +++ b/README.md @@ -129,6 +129,8 @@ information on what to include when reporting a bug. - [Win32] Bugfix: The window hint `GLFW_MAXIMIZED` did not move or resize the window (#1499) - [Cocoa] Bugfix: `glfwSetWindowSize` used a bottom-left anchor point (#1553) + - [Cocoa] Bugfix: Window remained on screen after destruction until event poll + (#1412) - [X11] Bugfix: The CMake files did not check for the XInput headers (#1480) - [X11] Bugfix: Key names were not updated when the keyboard layout changed (#1462,#1528) diff --git a/src/cocoa_window.m b/src/cocoa_window.m index c8af3321..ac22d7e3 100644 --- a/src/cocoa_window.m +++ b/src/cocoa_window.m @@ -962,6 +962,9 @@ void _glfwPlatformDestroyWindow(_GLFWwindow* window) [window->ns.object close]; window->ns.object = nil; + // HACK: Allow Cocoa to catch up before returning + _glfwPlatformPollEvents(); + } // autoreleasepool }