[wxPython-mac] Cross-posting: Problem with wx.Overlay/DCOverlay on OS X/Retina

Toby, Brian H. wrote:

There is a problem with Matplotlib zooming (wx backend) that occurs only
on Macs with a Retina display with wx 2.9.x and 3.0.0. The problem has
to do with using wx.Overlay to save a copy of a window and restore it
using a wx.DCOverlay & Clear. This is illustrated by that attached code
snippet. On a single machine, the same python, etc. it works fine if an
external display is used, but on Retina, the Clear() causes the contents
to be rescaled a factor of two larger (see pictures).

I’d like to know if this is a problem in wxwidgets or wxpython. It seems
to be the former. Can anyone confirm this?

Hi Brian,

Yes, this is a wxWidgets problem, likely something in wxOverlay being retina aware, and another part not being aware, or at least different default behaviors in the platform-level code used by wxOverlay.

I looked for workarounds back when those matplotlib tickets were created and didn't see anything obvious in the wxOverlay implementation on wxOSX that would help. Probably the best thing to do would be to use a different implementation in matplotlib for zooming that doesn't use wx.Overlay, but I haven't put any time into that yet.

···

--
Robin Dunn
Software Craftsman

There is a ticket in the wxWidgets system for this problem (wxTrac has been migrated to GitHub Issues - wxWidgets) so updates to wxPython will not help. I don’t know how to get it addressed.

···

On Wednesday, December 2, 2015 at 4:08:43 PM UTC-6, Matteo Andreozzi wrote:

Hi all,

does anyone know if this has been fixed or if there’s a workaround for it?
I’m on wxPython 3.0.2.0 osx-cocoa and I have exactly the same issue.