-
Notifications
You must be signed in to change notification settings - Fork 0
Description
During app startup, Panda3D calls the SetForegroundWindow()
winapi call, but somehow fails and logs the following:
:display:windisplay(warning): SetForegroundWindow() failed!
This can be reproduced by launching the app and immediately clicking somewhere. The app launches without focus, Windows tries to bring it to focus but fails, and without any error (or even events of failure) continues as if nothing happened, and mouse lock remains and puts the mouse in the middle of the screen on the other window, unable to move.
Hooking window-event
gives an event with the WindowProperties
's foreground
property still being True
despite actually not being in focus.
We somehow need to detect this problem and unlock the mouse. Already the window-event
hook does it when the window loses focus, but due to this issue it doesn't capture the window blur.