On 8.1.9 system.gui.getWindowNames() isn’t alphabetically sorting the results in a vision client but does so in the designer.
The Ignition 8.1 documentation leads me to believe the results should be sorted in both instances:
https://docs.inductiveautomation.com/display/DOC81/system.gui.getWindowNames