Merge pull request #6994 from kivy/matham-patch-2

Don't do event loop stuff when stopped.
This commit is contained in:
Gabriel Pettier 2020-09-27 12:17:31 +02:00 committed by GitHub
commit 0b7d327027
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 26 additions and 16 deletions

View File

@ -387,21 +387,26 @@ class EventLoopBase(EventDispatcher):
Clock.tick()
# read and dispatch input from providers
self.dispatch_input()
if not self.quit:
self.dispatch_input()
# flush all the canvas operation
Builder.sync()
if not self.quit:
Builder.sync()
# tick before draw
Clock.tick_draw()
if not self.quit:
Clock.tick_draw()
# flush all the canvas operation
Builder.sync()
if not self.quit:
Builder.sync()
window = self.window
if window and window.canvas.needs_redraw:
window.dispatch('on_draw')
window.dispatch('on_flip')
if not self.quit:
window = self.window
if window and window.canvas.needs_redraw:
window.dispatch('on_draw')
window.dispatch('on_flip')
# don't loop if we don't have listeners !
if len(self.event_listeners) == 0:
@ -421,21 +426,26 @@ class EventLoopBase(EventDispatcher):
await Clock.async_tick()
# read and dispatch input from providers
self.dispatch_input()
if not self.quit:
self.dispatch_input()
# flush all the canvas operation
Builder.sync()
if not self.quit:
Builder.sync()
# tick before draw
Clock.tick_draw()
if not self.quit:
Clock.tick_draw()
# flush all the canvas operation
Builder.sync()
if not self.quit:
Builder.sync()
window = self.window
if window and window.canvas.needs_redraw:
window.dispatch('on_draw')
window.dispatch('on_flip')
if not self.quit:
window = self.window
if window and window.canvas.needs_redraw:
window.dispatch('on_draw')
window.dispatch('on_flip')
# don't loop if we don't have listeners !
if len(self.event_listeners) == 0: