[pitivi] Fix the modality of the Welcome/Startup assistant



commit 2c29684b36953a2a64867e8faffda434ad7e849d
Author: Jean-François Fortin Tam <nekohayo gmail com>
Date:   Mon Nov 16 19:46:20 2015 -0500

    Fix the modality of the Welcome/Startup assistant
    
    With this, MainWindow fades out properly when running GNOME Shell,
    the Welcome dialog moves along when the main window is moved,
    and utility windows are prevented from showing on top on startup.
    
    This solves https://phabricator.freedesktop.org/T3468

 data/ui/startupwizard.ui        |    1 -
 pitivi/dialogs/startupwizard.py |    6 +++++-
 2 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/data/ui/startupwizard.ui b/data/ui/startupwizard.ui
index 36b127b..87726f8 100644
--- a/data/ui/startupwizard.ui
+++ b/data/ui/startupwizard.ui
@@ -5,7 +5,6 @@
   <object class="GtkWindow" id="window1">
     <property name="can_focus">False</property>
     <property name="title" translatable="yes">Welcome</property>
-    <property name="resizable">False</property>
     <property name="modal">True</property>
     <property name="window_position">center-on-parent</property>
     <property name="destroy_with_parent">True</property>
diff --git a/pitivi/dialogs/startupwizard.py b/pitivi/dialogs/startupwizard.py
index 0a71caf..dbfcf64 100644
--- a/pitivi/dialogs/startupwizard.py
+++ b/pitivi/dialogs/startupwizard.py
@@ -63,6 +63,11 @@ class StartUpWizard(object):
         self.builder.connect_signals(self)
 
         self.window = self.builder.get_object("window1")
+        # The line below is supremely important, it will NOT work if set
+        # only by the GtkBuilder file. The DIALOG TypeHint allows proper
+        # attachment (visually, behaviorally) to MainWindow, and
+        # prevents other windows from showing on top too easily.
+        self.window.set_type_hint(Gdk.WindowTypeHint.DIALOG)
 
         self.recent_chooser = self.builder.get_object("recentchooser2")
         # FIXME: gtk creates a combo box with only one item, but there is no
@@ -132,7 +137,6 @@ class StartUpWizard(object):
     def show(self):
         """Will show the interal window and position the wizard"""
         self.window.set_transient_for(self.app.gui)
-        self.window.set_position(Gtk.WindowPosition.CENTER_ON_PARENT)
         self.window.show()
 
     def hide(self):


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