diff --git a/src/internal.h b/src/internal.h index bfe24fb0..89c77cd7 100644 --- a/src/internal.h +++ b/src/internal.h @@ -344,6 +344,7 @@ void _glfwInputWindowFocus(_GLFWwindow* window, GLboolean activated); void _glfwInputWindowPos(_GLFWwindow* window, int x, int y); void _glfwInputWindowSize(_GLFWwindow* window, int width, int height); void _glfwInputWindowIconify(_GLFWwindow* window, int iconified); +void _glfwInputWindowDamage(_GLFWwindow* window); // Input event notification void _glfwInputKey(_GLFWwindow* window, int key, int action); diff --git a/src/win32_window.c b/src/win32_window.c index 930adccf..3442f5a3 100644 --- a/src/win32_window.c +++ b/src/win32_window.c @@ -1069,9 +1069,7 @@ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg, // Was the window contents damaged? case WM_PAINT: { - if (_glfwLibrary.windowRefreshCallback) - _glfwLibrary.windowRefreshCallback(window); - + _glfwInputWindowDamage(window); break; } diff --git a/src/window.c b/src/window.c index 131e41fa..29707bd1 100644 --- a/src/window.c +++ b/src/window.c @@ -195,6 +195,17 @@ void _glfwInputWindowIconify(_GLFWwindow* window, int iconified) } +//======================================================================== +// Register window damage events +//======================================================================== + +void _glfwInputWindowDamage(_GLFWwindow* window) +{ + if (_glfwLibrary.windowRefreshCallback) + _glfwLibrary.windowRefreshCallback(window); +} + + ////////////////////////////////////////////////////////////////////////// ////// GLFW public API ////// ////////////////////////////////////////////////////////////////////////// diff --git a/src/x11_window.c b/src/x11_window.c index c08b9b36..8ec19572 100644 --- a/src/x11_window.c +++ b/src/x11_window.c @@ -1349,9 +1349,7 @@ static void processSingleEvent(void) return; } - if (_glfwLibrary.windowRefreshCallback) - _glfwLibrary.windowRefreshCallback(window); - + _glfwInputWindowDamage(window); break; }