From e3e63fb1b88e0431dff218c0df2528d0751775bd Mon Sep 17 00:00:00 2001 From: Alex Shvartzkop Date: Tue, 28 May 2024 16:25:01 +0300 Subject: [PATCH] Disable hidpi cursors on GTK and OSX. wxCursor scale factors won't be supported before wx 3.3. MSW doesn't scale cursors, so it works as expected there. --- common/draw_panel_gal.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/common/draw_panel_gal.cpp b/common/draw_panel_gal.cpp index a868551683..68530a8820 100644 --- a/common/draw_panel_gal.cpp +++ b/common/draw_panel_gal.cpp @@ -662,7 +662,16 @@ void EDA_DRAW_PANEL_GAL::SetCurrentCursor( KICURSOR aCursor ) DPI_SCALING_COMMON dpi( nullptr, m_parent ); - m_gal->SetNativeCursorStyle( aCursor, dpi.GetContentScaleFactor() >= 2.0 ); + bool hidpi = false; + + // Cursor scaling factor cannot be set for a wxCursor on GTK and OSX (at least before wx 3.3), + // resulting in 4x rendered size on 2x window scale. + // MSW renders the bitmap as-is, without scaling, so this works here. +#ifdef __WXMSW__ + hidpi = dpi.GetContentScaleFactor() >= 2.0; +#endif + + m_gal->SetNativeCursorStyle( aCursor, hidpi ); }