Rseding91 wrote:I'm not sure on this original request. There are safety concerns such as making sure a mod doesn't try to focus a GUI element that isn't visible or focus one that shouldn't ever have focus.
Focusing a hidden element can either show it (the parent frame/dialog) or behave as if the element cannot be focused. Either would be safe, as long as the behavior is consistent and documented.
Trying to focus an off-screen element is the stickiest case, but if an element is off screen it's probably either in a dialog or in a part of a (visible) frame that is too large for the Factorio window. Move the dialog (center it?), refuse to focus off-screen elements, whatever—again, as long as the behavior is consistent and documented.
I'm sure there are safety concerns I haven't addressed (my GUI programming experience is quite limited), but I doubt there are any insoluble issues.