Missing keystroke/menu events after swapping windows

We have some buttons on our system which we use as a kind of sub-tabstrip navigation. However, they seem to result in client keystroke and menu events going missing (things like CTRL-S).

The code does a system.nav.openWindow(), then system.nav.closeWindow(). The “current” window is passed as a string because we ran into issues where system.nav.getCurrentWindow() would not always return the correct window when multiple windows were open (although I suspect this was fixed in 7.6).

Changing this to use system.nav.swapTo() works, but does not allow us to specify which window is being swapped. Using system.nav.swapWindow(oldPath, newPath) does not solve the problem.

Are there any known issues with losing focus or dropping keyevents when closing/swapping windows, anything I should be aware of when using these functions?


We are still having issues with this.

In one case, we have buttons which swap windows- we fixed the issue with these buttons by changing them to use system.nav.swapTo(). Using system.nav.closeWindow(string) or system.nav.swapWindow(string, string) causes missing events.

In another case, we have an app.nav.escape() function which does a system.nav.closeWindow(string) on the window at the top of the stack. This function is called if the escape key is pressed, or if our ‘Back’ button is clicked. When pressing escape, this works fine. However, when clicking on the back button, Microsoft Windows users often end up with client keyevents not being fired until they open another window. I am currently unable to reproduce this problem on Linux, or with a remote desktop connection to a Windows machine.

The one common link between these two cases is that the buttons are in templates, and the windows are being closed by string path rather than by FPMIWindow object. Is it possible that there is a bug with templates that causes events to get lost if their parent window is closed?

Any information would be much appreciated in trying to help track this down.

How do client keystroke events work? Which object are they listening to? Is there any kind of handover process between windows when they are closed, opened, swapped, etc?

How would these events go missing? Is there anything I can do to rule out a windowmanager issue, to make sure Windows is not stealing the event focus for example?


If I were troubleshooting this problem I would focus on one specific case/window where the problem is reproducible every time.

Add print statements to the keyPressed events for EVERY component that handles key press event on both the window and your navigation controls.

print "**KEY PRESS EVENT** %s: %s" % (system.gui.getParentWindow(event), event.source.name)

This should help you find out exactly what is happening to your key presses.