So this is a strange one.
We have a multi-monitor system that I’m using system.gui.getScreenIndex to get the screen index that the operator clicks on to properly show popups etc at the location of the mouse.
Old post
This all works fine, until I’m two functions deep.
Suppose I have two functions:
def functionA():
Do stuff to figure out which popup to show etc...
Call functionB
def functionB():
Do stuff to position the popup
On the template I call functionA to determine the popup, which in turn calls functionB to position the popup.
If I have a button that calls functionA on a window that I know is screenIndex 1 and check system.gui.screenIndex it returns a 1. However if functionA then calls functionB and I check system.gui.screenIndex it returns a 0. Now… if I just straight up call functionB from the window it properly returns system.gui.screenIndex then 1 is returned not 0.
Any idea why? I can get around it in my code… I just wanted to bring this up and see if this is a known issue or not.
OK… so after more testing it isn’t the embedded function calling.
After I issue a system.nav.openWindowInstance the screen index is reset to 0. This occurs even when I specifically enumerate the desktop to open the window on with either the screen index or the desktop handle using system.nav.desktop(handle).openWindowInstance.
Any reason this is happening? I’ve got a work around… I just save the screen index before calling openWindowInstance but this seems to not be working as intended.