_errorview dialog mapped without transient parent

Fixes #8128.
This commit is contained in:
prculley 2017-06-12 11:18:24 -05:00 committed by Nick Hall
parent c1aeb6b203
commit 6ece4ce742
2 changed files with 7 additions and 2 deletions

View File

@ -119,7 +119,7 @@ class ErrorReportAssistant(ManagedWindow, Gtk.Assistant):
if self.parent_window is not None:
self._save_position(save_config=False) # the next line saves it
self._save_size()
self.hide()
self.destroy()
if self.ownthread:
Gtk.main_quit()

View File

@ -106,8 +106,13 @@ class ErrorView(ManagedWindow):
def draw_window(self):
title = "%s - Gramps" % _("Error Report")
self.top = Gtk.Dialog(title)
# look over the top level windows, it seems the oldest come first, so
# the most recent still visible window appears to be a good choice for
# a transient parent
for win in self.top.list_toplevels():
if win.is_active():
if win == self.top: # not interested if this is us...
continue
if win.is_toplevel() and win.is_visible():
self.parent_window = win # for ManagedWindow
if self.parent_window is None: # but it is on some screen
self.parent_window = self.top.get_screen()