From 581cc989de3b1332d51589e7cb4502903772e072 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Leclercq?= Date: Fri, 4 Nov 2016 22:57:07 +0100 Subject: [PATCH] Utility/Win32: Fix cached position never getting updated with threaded windows Closes #104 --- src/Nazara/Utility/Win32/WindowImpl.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/Nazara/Utility/Win32/WindowImpl.cpp b/src/Nazara/Utility/Win32/WindowImpl.cpp index 8a4ce99f4..0c1d23050 100644 --- a/src/Nazara/Utility/Win32/WindowImpl.cpp +++ b/src/Nazara/Utility/Win32/WindowImpl.cpp @@ -792,12 +792,17 @@ namespace Nz RECT windowRect; GetWindowRect(m_handle, &windowRect); - WindowEvent event; - event.type = WindowEventType_Moved; - event.position.x = windowRect.left; - event.position.y = windowRect.top; - m_parent->PushEvent(event); + Vector2i position(windowRect.left, windowRect.top); + if (m_position != position) + { + m_position = position; + WindowEvent event; + event.type = WindowEventType_Moved; + event.position.x = position.x; + event.position.y = position.y; + m_parent->PushEvent(event); + } break; }