[anaconda 1/3] Maximize anaconda instead of running fullscreen (#1164457)

David Shea dshea at redhat.com
Tue Jan 13 22:07:24 UTC 2015


A fullscreen anaconda is inconvenient when running outside of the
regular installer media, since on Live installs some things are only
configurable in the desktop environment, and on dir and image installs
you might have other things to do while anaconda is running. Instead,
maximize anaconda and use the hide-titlebar-when-maximized property to
hide the titlebar on window manager that support it, which is really
just GNOME.
---
 pyanaconda/ui/gui/__init__.py | 25 +++++++------------------
 1 file changed, 7 insertions(+), 18 deletions(-)

diff --git a/pyanaconda/ui/gui/__init__.py b/pyanaconda/ui/gui/__init__.py
index bd6941d..40a7375 100644
--- a/pyanaconda/ui/gui/__init__.py
+++ b/pyanaconda/ui/gui/__init__.py
@@ -271,6 +271,11 @@ class MainWindow(Gtk.Window):
     def __init__(self):
         Gtk.Window.__init__(self)
 
+        # Hide the titlebar when maximized if the window manager allows it.
+        # This makes anaconda look full-screenish but without covering parts
+        # needed to interact with the window manager, like the GNOME top bar.
+        self.set_hide_titlebar_when_maximized(True)
+
         # Treat an attempt to close the window the same as hitting quit
         self.connect("delete-event", self._on_delete_event)
 
@@ -300,12 +305,8 @@ class MainWindow(Gtk.Window):
         self._accel_group = Gtk.AccelGroup()
         self.add_accel_group(self._accel_group)
 
-        # Connect to window-state-event changes to catch when the user
-        # maxmizes/unmaximizes the window.
-        self.connect("window-state-event", self._on_window_state_event)
-
-        # Start the window as full screen
-        self.fullscreen()
+        # Start the window maximized
+        self.maximize()
 
         self._overlay.add(self._stack)
         self.add(self._overlay)
@@ -313,18 +314,6 @@ class MainWindow(Gtk.Window):
 
         self._current_action = None
 
-    def _on_window_state_event(self, window, event, user_data=None):
-        # If the window is being maximized, fullscreen it instead
-        if (Gdk.WindowState.MAXIMIZED & event.changed_mask) and \
-                (Gdk.WindowState.MAXIMIZED & event.new_window_state):
-            self.fullscreen()
-
-            # Return true to stop the signal handler since we're changing
-            # state mid-stream here
-            return True
-
-        return False
-
     def _on_delete_event(self, widget, event, user_data=None):
         # Use the quit-clicked signal on the the current standalone, even if the
         # standalone is not currently displayed.
-- 
2.1.0



More information about the anaconda-patches mailing list