From 1e3c624613d7fbea8449b95ffff6d3104a9312c0 Mon Sep 17 00:00:00 2001 From: bendikro Date: Tue, 5 Nov 2019 15:45:30 +0100 Subject: [GTK] Destroy the dialog before running the callback Currently, the dialog window is displayed until after the callback has returned. The result is that if a new dialog is opened from the callback, the first dialog is still displayed until the new dialog is destroyed. Fix by destroying the dialog before running the callback. --- deluge/ui/gtk3/dialogs.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/deluge/ui/gtk3/dialogs.py b/deluge/ui/gtk3/dialogs.py index 5169ab453..deea10515 100644 --- a/deluge/ui/gtk3/dialogs.py +++ b/deluge/ui/gtk3/dialogs.py @@ -72,12 +72,12 @@ class BaseDialog(Gtk.Dialog): self.vbox.show_all() def _on_delete_event(self, widget, event): - self.deferred.callback(Gtk.ResponseType.DELETE_EVENT) self.destroy() + self.deferred.callback(Gtk.ResponseType.DELETE_EVENT) def _on_response(self, widget, response): - self.deferred.callback(response) self.destroy() + self.deferred.callback(response) def run(self): """ @@ -110,6 +110,8 @@ class YesNoDialog(BaseDialog): (_('_No'), Gtk.ResponseType.NO, _('_Yes'), Gtk.ResponseType.YES), parent, ) + # Use the preferred size calculated from the content + self.set_default_size(-1, -1) class InformationDialog(BaseDialog): -- cgit