[PATCH] Maximize anaconda instead of running fullscreen (#1231856)

David Shea dshea at redhat.com
Tue Sep 22 15:25:58 UTC 2015


On 09/22/2015 09:34 AM, Martin Kolman wrote:
> From: David Shea <dshea at redhat.com>
>
> 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 managers that support it, which is really
> just GNOME.
>
> Add an option to GraphicalUserInterface to start with a fullscreen
> anaconda for downstream users of the GUI that would prefer that
> behavior.
>
> Related: rhbz#1231856
> Signed-off-by: Martin Kolman <mkolman at redhat.com>
> ---
>   pyanaconda/anaconda.py        |  5 ++++-
>   pyanaconda/ui/gui/__init__.py | 26 +++++++++++++++++---------
>   2 files changed, 21 insertions(+), 10 deletions(-)
>
> diff --git a/pyanaconda/anaconda.py b/pyanaconda/anaconda.py
> index 8e9e777..f88c42a 100644
> --- a/pyanaconda/anaconda.py
> +++ b/pyanaconda/anaconda.py
> @@ -206,8 +206,11 @@ class Anaconda(object):
>   
>           if self.displayMode == 'g':
>               from pyanaconda.ui.gui import GraphicalUserInterface
> +            # Run the GUI in non-fullscreen mode, so live installs can still
> +            # use the window manager
>               self._intf = GraphicalUserInterface(self.storage, self.payload,
> -                                                self.instClass, gui_lock=self.gui_initialized)
> +                                                self.instClass, gui_lock=self.gui_initialized,
> +                                                fullscreen=False)
>   
>               # needs to be refreshed now we know if gui or tui will take place
>               addon_paths = addons.collect_addon_paths(constants.ADDON_PATHS,
> diff --git a/pyanaconda/ui/gui/__init__.py b/pyanaconda/ui/gui/__init__.py
> index e50aeb4..aedaa57 100644
> --- a/pyanaconda/ui/gui/__init__.py
> +++ b/pyanaconda/ui/gui/__init__.py
> @@ -370,9 +370,18 @@ class ErrorDialog(GUIObject):
>   class MainWindow(Gtk.Window):
>       """This is a top-level, full size window containing the Anaconda screens."""
>   
> -    def __init__(self):
> +    def __init__(self, fullscreen):
> +        """Create a new anaconda main window.
> +
> +          :param bool fullscreen: if True, fullscreen the window, if false maximize
> +        """
>           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)
>   
> @@ -400,12 +409,11 @@ 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()
> +        # Make the window big
> +        if fullscreen:
> +            self.fullscreen()
> +        else:
> +            self.maximize()
>   
>           self._overlay.add(self._stack)
>           self.add(self._overlay)

Since you're removing the use of _on_window_state_event, you can remove 
the method, too.

> @@ -595,7 +603,7 @@ class GraphicalUserInterface(UserInterface):
>       """
>       def __init__(self, storage, payload, instclass,
>                    distributionText = product.distributionText, isFinal = product.isFinal,
> -                 quitDialog = QuitDialog, gui_lock = None):
> +                 quitDialog = QuitDialog, gui_lock = None, fullscreen=False):
>   
>           UserInterface.__init__(self, storage, payload, instclass)
>   
> @@ -606,7 +614,7 @@ class GraphicalUserInterface(UserInterface):
>   
>           self.data = None
>   
> -        self.mainWindow = MainWindow()
> +        self.mainWindow = MainWindow(fullscreen=fullscreen)
>   
>           self._distributionText = distributionText
>           self._isFinal = isFinal

Looks good otherwise.


More information about the anaconda-patches mailing list