From e2ef26cf83d089cc58be178e8784f1b46997d7b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Fri, 19 Jan 2018 22:06:06 +0100 Subject: [PATCH] Ensure toplevel window is actually a WINDOW_TOPLEVEL type The window_list_toplevels may return also WINDOW_POPUP which is not usable to be set as parent. This happens when a toplevel window is searched from the activate event of a popup menu. issue7061 review43901002 --- tryton/common/common.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tryton/common/common.py b/tryton/common/common.py index 2a6e1f1b01..1ee899d355 100644 --- a/tryton/common/common.py +++ b/tryton/common/common.py @@ -300,7 +300,7 @@ def request_server(server_widget): def get_toplevel_window(): for window in gtk.window_list_toplevels(): - if window.is_active(): + if window.is_active() and window.props.type == gtk.WINDOW_TOPLEVEL: return window from tryton.gui.main import Main return Main.get_main().window