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
This commit is contained in:
1 parent
a2ccd96770
commit
e2ef26cf83
1 file changed
+1
-1
@@ -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
|
||||
|
||||
Reference in new issue
Block a user