You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems that for some reason the NSTimer that backs the timer events doesn't fire while a menu is open. When the menu is closed the event fires immediately and things continue as usual.
You can see this effect by opening the timer example and clicking the application menu. The box which normally is shifted over every 10ms should freeze in place until the menu is closed. By increasing the interval (10ms -> 5000ms) and the jump distance (2px -> 20px) it's easier to see how events are delayed and fired immediately once the menu is closed.
I did some digging and the handle_timer function in window.rs isn't called, so the issue is happening somewhere on the NSTimer side. After some research, it seems like the menu might be somehow "hogging" whatever run loop the NSTimer is scheduled on, meaning the timer can't check whether to trigger until the menu closes and "releases" the run loop.
The text was updated successfully, but these errors were encountered:
This issue also exists on Windows with the context menu. The timer event gets dropped completely when the context menu is open. In addition, when there are multiple windows with timers and I open the context menu, then the whole app crashes due to double mutable borrow.
For the multi-window and context menu testing I modified the multiwin example by adding the following into the Glow widget's event method:
I confirmed the app menu bug on macOS. The context menu also causes the same issue on macOS, i.e. the timers get delayed. When multiple windows are open then opening the context menu delays the timers on all of them. There's no crash on macOS though.
It seems that for some reason the
NSTimer
that backs the timer events doesn't fire while a menu is open. When the menu is closed the event fires immediately and things continue as usual.You can see this effect by opening the
timer
example and clicking the application menu. The box which normally is shifted over every 10ms should freeze in place until the menu is closed. By increasing the interval (10ms -> 5000ms) and the jump distance (2px -> 20px) it's easier to see how events are delayed and fired immediately once the menu is closed.I did some digging and the
handle_timer
function inwindow.rs
isn't called, so the issue is happening somewhere on theNSTimer
side. After some research, it seems like the menu might be somehow "hogging" whatever run loop theNSTimer
is scheduled on, meaning the timer can't check whether to trigger until the menu closes and "releases" the run loop.The text was updated successfully, but these errors were encountered: