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 the behaviour of Screen.PollEvent() has changed with v2.7.0. Whereas before, PollEvent() blocked between a call to Screen.Suspend() and Screen.Resume(), now it returns with a nil value.
Was this change intended? The documentation says that PollEvent() "will return nil if the Screen is finalized" and I would not consider a suspended screen finalized. So I would expect PollEvent() to block until the next event is received, as it was before v2.7.0.
If this change was intended, I think it should be documented ("if the Screen is finalized or suspended"). Then (at least in tview) I would have to keep track of suspended states whereas now, I use the nil value solely to determine if a screen has been finalized. Personally, though, I would like this to go back to how it was before (i.e. PollEvent() blocks until the next event from an active screen).
Here's some code to reproduce this:
funcmain() {
s, _:=tcell.NewScreen()
s.Init()
s.PollEvent()
s.Suspend()
s.PollEvent() // This returns with nil in v2.7.0. It blocks in v2.6.1.s.Resume()
s.PollEvent()
s.Fini()
}
The text was updated successfully, but these errors were encountered:
It seems that the behaviour of
Screen.PollEvent()
has changed with v2.7.0. Whereas before,PollEvent()
blocked between a call toScreen.Suspend()
andScreen.Resume()
, now it returns with anil
value.Was this change intended? The documentation says that
PollEvent()
"will return nil if the Screen is finalized" and I would not consider a suspended screen finalized. So I would expectPollEvent()
to block until the next event is received, as it was before v2.7.0.If this change was intended, I think it should be documented ("if the Screen is finalized or suspended"). Then (at least in
tview
) I would have to keep track of suspended states whereas now, I use thenil
value solely to determine if a screen has been finalized. Personally, though, I would like this to go back to how it was before (i.e.PollEvent()
blocks until the next event from an active screen).Here's some code to reproduce this:
The text was updated successfully, but these errors were encountered: