Dragging between displays on MacOS can mess up canvas

Description

On MacOS with multiple displays with different resolution, canvas scale and cursor position mapping gets messed up if I drag a window from one display to another.

The attached recording is an OBS scene with the border between two displays in the middle, showing the issue.

2020-01-24_09-55-12.mkv

I have canvas scale in KiCad set to automatic. Left display is 2880x1800 with custom UI scaling. Right display is 2560x1440 also with custom scaling. Everything works great as long as I only ever use the software on whatever display it first opens on.

Steps to reproduce

  1. Start a KiCad app that uses a drawing canvas on one display
  2. Drag it to another display

KiCad Version

Application: KiCad
Version: (5.99.0-788-g8f778b5a0), debug build
Libraries:
    wxWidgets 3.0.5
    libcurl/7.54.0 LibreSSL/2.6.5 zlib/1.2.11 nghttp2/1.24.1
Platform: Mac OS X (Darwin 18.7.0 x86_64), 64 bit, Little endian, wxMac
Build Info:
    Build date: Jan 22 2020 17:25:34
    wxWidgets: 3.0.5 (wchar_t,STL containers,compatible with 2.8)
    Boost: 1.69.0
    Curl: 7.64.1
    Compiler: Clang 11.0.0 with C++ ABI 1002

Build settings:
    KICAD_SCRIPTING=OFF
    KICAD_SCRIPTING_MODULES=OFF
    KICAD_SCRIPTING_PYTHON3=OFF
    KICAD_SCRIPTING_WXPYTHON=OFF
    KICAD_SCRIPTING_WXPYTHON_PHOENIX=OFF
    KICAD_SCRIPTING_ACTION_MENU=OFF
    BUILD_GITHUB_PLUGIN=ON
    KICAD_USE_OCE=OFF
    KICAD_USE_OCC=OFF
    KICAD_SPICE=ON
    KICAD_STDLIB_DEBUG=OFF
    KICAD_STDLIB_LIGHT_DEBUG=OFF
    KICAD_SANITIZE=OFF