The mouse is repositioned from
remove_popup_interface, which is called from
gui_on_mouse_up. Correction to the above: The mouse is only repositioned if clicking on an enabled GUI button, slider, listbox, or inventory window, after
process_interface_click has been run. It still seems (to me) counter-intuitive to move the mouse and hide the GUI if the click didn't do anything though. However, I can't really think of any justification for an enabled control of these types with no associated action as a general case.
That said, I keep going back and forth on whether this should be considered as "by-design" or not. Is automatically moving the mouse like this actually something that should be hard-coded into the engine? Perhaps it would make more sense to expose the PopupAtMouseY and PopupStyle to the script API, and update the default template to preserve this behavior while not enforcing it at the engine level.
