From 826c0cc12777f5af400d91ebfa2ff59cdf3f9a80 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 --- 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 09347e69a7..adf3ea2fef 100644 --- a/tryton/common/common.py +++ b/tryton/common/common.py @@ -1009,10 +1009,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