Skip to content

Commit

Permalink
tkinter: Handle race condition when entering fullscreen mode
Browse files Browse the repository at this point in the history
  • Loading branch information
einarf committed Oct 9, 2019
1 parent 80e56cd commit e1cb85e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions moderngl_window/context/tk/window.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,12 @@ def tk_resize(self, event) -> None:
self._width, self._height = event.width, event.height
# TODO: How do we know the actual buffer size?
self._buffer_width, self._buffer_height = event.width, event.height

# Race condition when going fullscreen mode.
# The moderngl context might not be created yet.
if not self._ctx:
return

self.set_default_viewport()
self._resize_func(event.width, event.height)

Expand Down

0 comments on commit e1cb85e

Please sign in to comment.