mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-11 08:27:29 -04:00
container: handle open/close events on rendering thread
Windows does not allow changing the gl cursor mode on non main thread (or at least it behaves undefined). Both events may be called from any thread (e.g. the network thread when opening a chest). Thread safety was not guaranteed anymore and thus breaking. Fixes #118
This commit is contained in:
parent
a63b020e53
commit
ae7b15de10
@ -72,7 +72,8 @@ object ContainerGUIManager {
|
||||
|
||||
registerLocalContainerEvent(guiRenderer)
|
||||
|
||||
guiRenderer.connection.events.listen<ContainerOpenEvent> { open(guiRenderer, it.container) }
|
||||
guiRenderer.connection.events.listen<ContainerCloseEvent> { close(guiRenderer, it.container) }
|
||||
val queue = guiRenderer.context.queue
|
||||
guiRenderer.connection.events.listen<ContainerOpenEvent> { queue += { open(guiRenderer, it.container) } }
|
||||
guiRenderer.connection.events.listen<ContainerCloseEvent> { queue += { close(guiRenderer, it.container) } }
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user