It sounds like a scaling bug on Microsoft’s end then. They’ve blogged about it last year (link below), but it sounds like they never fixed it. And I assume you did these updates via the phone and didn’t use the older insider preview updates which were buggy.
http://answers.microsoft.com/en-us/insider/forum/insider_wintp-insider_update/lumia-640-users-check-here-for-windows-10/e45ddf8c-5660-44bf-aa16-4a2d23c59883
If this is the case, then I’m afraid there is not much more we can do on our end. The issue here is that operating system is returning the wrong resolution and scale factor for the device. If Corona can detect the discrepancy, then we’ll work-around it. But if we can’t detect it (all of the OS APIs lie about the resolution), then we have no choice but to accept that the OS is telling the truth.
I remember this being the case for the Lumia 535 after updating it to Windows 10 Mobile. For that device, I posted a C# work-around which identifies that specific device, and if detected, disables background rendering… which unfortunately makes 60 FPS impossible. I posted this code here…
https://forums.coronalabs.com/topic/62285-windows-phone-10-black-borders/?p=324087
You could do the same for the Lumia 640XL if you want. It’s not a great solution, but I’m not sure what else we can do.
And as a quick test, you can set background rendering in C# to false to see if it’ll render fullscreen (no scaling issues).
fCoronaPanel.BackgroundRenderingEnabled = false;