- // TODO: what coordinates are these in: window, client, or screen?
- bool ret = (ImageList_DragMove( pt.x, pt.y ) != 0);
+ // These are in window, not client coordinates.
+ // So need to convert to client coordinates.
+ wxPoint pt2(pt);
+ if (m_window && !m_fullScreen)
+ {
+ RECT rect;
+ rect.left = 0; rect.top = 0;
+ rect.right = 0; rect.bottom = 0;
+ DWORD style = ::GetWindowLong((HWND) m_window->GetHWND(), GWL_STYLE);
+#ifdef __WIN32__
+ DWORD exStyle = ::GetWindowLong((HWND) m_window->GetHWND(), GWL_EXSTYLE);
+ ::AdjustWindowRectEx(& rect, style, FALSE, exStyle);
+#else
+ ::AdjustWindowRect(& rect, style, FALSE);
+#endif
+ // Subtract the (negative) values, i.e. add a small increment
+ pt2.x -= rect.left; pt2.y -= rect.top;
+ }
+ else if (m_window && m_fullScreen)
+ {
+ pt2 = m_window->ClientToScreen(pt2);
+ }
+
+ bool ret = (ImageList_DragMove( pt2.x, pt2.y ) != 0);