From 0dab4c50824b3e37bf683071c20a6d45a7768bf5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 3 Jun 2010 20:08:54 +0200 Subject: [PATCH] Process all pending events when calling main_iteration for issue1571 (transplanted from dac9e96ee7aa7579db1fe33c1f31e0092325da15) --- tryton/common/cellrendererbutton.py | 3 ++- tryton/common/common.py | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/tryton/common/cellrendererbutton.py b/tryton/common/cellrendererbutton.py index 4ea797c3b5..f57f83b468 100644 --- a/tryton/common/cellrendererbutton.py +++ b/tryton/common/cellrendererbutton.py @@ -77,7 +77,8 @@ class CellRendererButton(gtk.GenericCellRenderer): and event.keyval == gtk.keysyms.space)): self.clicking = True widget.queue_draw() - gtk.main_iteration() + while gtk.events_pending(): + gtk.main_iteration() self.emit("clicked", path) def timeout(self, widget): self.clicking = False diff --git a/tryton/common/common.py b/tryton/common/common.py index 9f5c16c6d7..5be244f904 100644 --- a/tryton/common/common.py +++ b/tryton/common/common.py @@ -1004,10 +1004,12 @@ class RPCProgress(object): win.set_modal(True) win.show_all() progressbar.pulse() - gtk.main_iteration() + while gtk.events_pending(): + gtk.main_iteration() if win: win.destroy() - gtk.main_iteration() + while gtk.events_pending(): + gtk.main_iteration() if self.exception: raise self.exception return self.res