From e79466f02b62a0612e3704a52e21307a07580689 Mon Sep 17 00:00:00 2001 From: AliKet Date: Fri, 9 Feb 2024 21:17:24 +0100 Subject: [PATCH] Fix wxOverlay when used with a TLW under wxMSW Correctly position the overlay window over the TLW's client area. --- src/msw/overlay.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/msw/overlay.cpp b/src/msw/overlay.cpp index fd94364ad6..62298891c8 100644 --- a/src/msw/overlay.cpp +++ b/src/msw/overlay.cpp @@ -99,8 +99,9 @@ void wxOverlayImpl::Init(wxDC* dc, int , int , int , int ) m_window = dc->GetWindow(); - m_rect.SetSize(m_window->GetClientSize()); - m_rect.SetPosition(m_window->GetScreenPosition()); + // The rectangle must be in screen coordinates + m_rect = m_window->GetClientRect(); + m_window->ClientToScreen(&m_rect.x, &m_rect.y); m_bitmap.CreateWithLogicalSize(m_rect.GetSize(), m_window->GetDPIScaleFactor());