[gnome-music/gbsneto/fix-about-dialog: 1/2] aboutdialog: Present after setting transient window



commit 09059a2139d5f220938def68e23680760626c217
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Mon Apr 15 12:07:52 2019 -0300

    aboutdialog: Present after setting transient window
    
    Presenting a window is a big, imporant operation surrounded
    by various constraints. By the time a window is presented,
    various informations are sent to the window manager so it
    can figure out where to place and size it, etc.
    
    One of such information is the "transient" toplevel: when
    presenting a window, this property must be already set, and
    not change after; changing it after the window is presented
    is undefined, and may or may not work depending on how
    advanced the window manager reading the communication socket.
    
    GNOME Music currently sets the transient toplevel after
    showing the About dialog, which causes problems already.
    
    Fix that by showing the About dialog only after setting the
    transient-for toplevel property.
    
    Fixes http://gitlab.gnome.org/GNOME/gnome-music/issues/261

 gnomemusic/application.py         | 1 +
 gnomemusic/widgets/aboutdialog.py | 2 --
 2 files changed, 1 insertion(+), 2 deletions(-)
---
diff --git a/gnomemusic/application.py b/gnomemusic/application.py
index a0b0b8f5..465b3d69 100644
--- a/gnomemusic/application.py
+++ b/gnomemusic/application.py
@@ -119,6 +119,7 @@ class Application(Gtk.Application):
     def _about(self, action, param):
         about = AboutDialog()
         about.props.transient_for = self._window
+        about.show()
 
     @log
     def do_startup(self):
diff --git a/gnomemusic/widgets/aboutdialog.py b/gnomemusic/widgets/aboutdialog.py
index 6cd4e8d6..84630b81 100644
--- a/gnomemusic/widgets/aboutdialog.py
+++ b/gnomemusic/widgets/aboutdialog.py
@@ -42,8 +42,6 @@ class AboutDialog(Gtk.AboutDialog):
 
         self.connect("response", self._about_response)
 
-        self.show()
-
     @log
     def _about_response(self, klass, data=None):
         klass.destroy()


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]