On Wed, 2014-07-09 at 16:02 -0400, David Shea wrote:
Start anaconda in fullscreen mode. If a user unfullscreens the window
it
will be decorated, and if the window is later maximized it will be
fullscreened again.
---
pyanaconda/ui/gui/__init__.py | 21 ++++++++++++++++++---
1 file changed, 18 insertions(+), 3 deletions(-)
diff --git a/pyanaconda/ui/gui/__init__.py b/pyanaconda/ui/gui/__init__.py
index 7055414..ecc12d5 100644
--- a/pyanaconda/ui/gui/__init__.py
+++ b/pyanaconda/ui/gui/__init__.py
@@ -268,9 +268,12 @@ class MainWindow(Gtk.Window):
self._accel_group = Gtk.AccelGroup()
self.add_accel_group(self._accel_group)
- # Set properties on the window
- self.set_decorated(False)
- self.maximize()
+ # 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()
self._overlay.add(self._stack)
self.add(self._overlay)
@@ -278,6 +281,18 @@ 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.
ACK.
--
Vratislav Podzimek
Anaconda Rider | RHCE | Red Hat, Inc. | Brno - Czech Republic