From 56ab02f54dcb298fe4fb25e8b8f83aea0b233be3 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Thu, 2 Mar 2017 18:41:28 +0100 Subject: [PATCH] Set tab as parent for print dialogs Fixes #2366 --- CHANGELOG.asciidoc | 1 + qutebrowser/browser/commands.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index 4e96af7bc..36656b3df 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -31,6 +31,7 @@ Fixed - Hinting a input now doesn't select existing text anymore with QtWebKit - The cursor now moves to the end when input elements are selected with QtWebEngine - Download suffixes like (1) are now correctly stripped with QtWebEngine +- Crash when trying to print a tab which was closed in the meantime v0.10.0 ------- diff --git a/qutebrowser/browser/commands.py b/qutebrowser/browser/commands.py index a3bdd2a23..d728afa55 100644 --- a/qutebrowser/browser/commands.py +++ b/qutebrowser/browser/commands.py @@ -350,7 +350,7 @@ class CommandDispatcher: message.error("Printing failed!") tab.printing.check_preview_support() - diag = QPrintPreviewDialog() + diag = QPrintPreviewDialog(tab) diag.setAttribute(Qt.WA_DeleteOnClose) diag.setWindowFlags(diag.windowFlags() | Qt.WindowMaximizeButtonHint | Qt.WindowMinimizeButtonHint) @@ -376,7 +376,7 @@ class CommandDispatcher: message.error("Printing failed!") diag.deleteLater() - diag = QPrintDialog() + diag = QPrintDialog(tab) diag.open(lambda: tab.printing.to_printer(diag.printer(), print_callback))