From 6dba08f4969726feb79ccb513dc1e7ccccb6975f Mon Sep 17 00:00:00 2001 From: oscfdezdz <42654671+oscfdezdz@users.noreply.github.com> Date: Sat, 8 Apr 2023 17:10:05 +0200 Subject: [PATCH] Add `transient_for` property to about dialog --- src/diffuse/dialogs.py | 3 ++- src/diffuse/window.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/diffuse/dialogs.py b/src/diffuse/dialogs.py index e9e0ac0..3ca2a83 100644 --- a/src/diffuse/dialogs.py +++ b/src/diffuse/dialogs.py @@ -33,8 +33,9 @@ from gi.repository import GObject, Gtk # type: ignore # noqa: E402 # the about dialog class AboutDialog(Gtk.AboutDialog): - def __init__(self) -> None: + def __init__(self, parent: Gtk.Widget) -> None: Gtk.AboutDialog.__init__(self) + self.set_transient_for(parent) self.set_logo_icon_name('io.github.mightycreak.Diffuse') self.set_program_name(constants.APP_NAME) self.set_version(constants.VERSION) diff --git a/src/diffuse/window.py b/src/diffuse/window.py index cc4355f..7f93c7e 100644 --- a/src/diffuse/window.py +++ b/src/diffuse/window.py @@ -1791,7 +1791,7 @@ class DiffuseWindow(Gtk.ApplicationWindow): # callback for the about menu item def about_cb(self, widget, data): - dialog = AboutDialog() + dialog = AboutDialog(self.get_toplevel()) dialog.run() dialog.destroy()