window.frameLocation getting UI-scaled! [scripting]
In ID v17.3 I have a dialog that I need to close, then re-open exactly at the same spot after doing some work on the Document, i.e.
var oldDlg = new MyDialog();
oldDlg.show();
var oldLocation = oldDlg.win.frameLocation; //e.g. [100, 100];
// ... do some stuff to the Document ...
var newDlg = new MyDialog();
newDlg.win.frameLocation = oldLocation; //tried doing this from onShow, but no difference
newDlg.show(); //doesn't show at the same place, shows up at 2x old coordinates
var newLocation = newDlg.win.frameLocation; //this is now e.g. [200, 200]!!!In other words, the frameLocation that's reported after the show() is MULTIPLIED by the current internal UI scaling factor, 2x in this case. Sure enough, the multiplication factor changes depending on the UI Scaling preference, so UI Scaling has to be in effect. Yet, show() of the new dialog needs frameLocation in UN-multiplied units!
This smells like a bug. I can work around it by pre-adjusting oldLocation by multiplying by (oldDlg.win.preferredSize[0] / oldDlg.win.size[0]), but what if Adobe come back and fix this someday and break my script in the process? (BTW Adobe, the discrepancy of preferredSize vs size is also nonsensical.)
So, is this a feature or a bug? If so, in which versions?
Does anybody have a safer idea for a workaround?
Thanks!

