diff --git a/src/virtManager/console.py b/src/virtManager/console.py
index 81839ee2c..5433fb3c1 100644
--- a/src/virtManager/console.py
+++ b/src/virtManager/console.py
@@ -553,7 +553,7 @@ class vmmConsolePages(vmmGObjectUI):
self.tunnels = None
self.viewerRetriesScheduled = 0
self.viewerRetryDelay = 125
- self.viewer_connected = False
+ self._viewer_connected = False
self.viewer_connecting = False
self.scale_type = self.vm.get_console_scaling()
@@ -584,6 +584,8 @@ class vmmConsolePages(vmmGObjectUI):
self.add_gconf_handle(
self.config.on_console_accels_changed(self.set_enable_accel))
+ self.page_changed()
+
def is_visible(self):
if self.topwin.flags() & gtk.VISIBLE:
return 1
@@ -924,6 +926,21 @@ class vmmConsolePages(vmmGObjectUI):
if self.viewer and self.viewer.get_widget():
self.viewer.get_widget().grab_focus()
+ def page_changed(self, ignore1=None, ignore2=None, ignore3=None):
+ self.set_allow_fullscreen()
+
+ def set_allow_fullscreen(self):
+ cpage = self.window.get_widget("console-pages").get_current_page()
+ dpage = self.window.get_widget("details-pages").get_current_page()
+
+ allow_fullscreen = (dpage == 0 and
+ cpage == PAGE_VIEWER and
+ self.viewer_connected)
+
+ print "ALLOW FULLSCREEN", dpage, cpage, self.viewer_connected, allow_fullscreen
+ self.window.get_widget("control-fullscreen").set_sensitive(allow_fullscreen)
+ self.window.get_widget("details-menu-view-fullscreen").set_sensitive(allow_fullscreen)
+
def disconnected(self):
errout = ""
if self.tunnels is not None:
@@ -951,6 +968,13 @@ class vmmConsolePages(vmmGObjectUI):
self.activate_unavailable_page(error)
+ def _set_viewer_connected(self, val):
+ self._viewer_connected = val
+ self.set_allow_fullscreen()
+ def _get_viewer_connected(self):
+ return self._viewer_connected
+ viewer_connected = property(_get_viewer_connected, _set_viewer_connected)
+
def connected(self):
self.viewer_connected = True
logging.debug("Viewer connected")
diff --git a/src/virtManager/details.py b/src/virtManager/details.py
index 6117c1c41..9a0d5622f 100644
--- a/src/virtManager/details.py
+++ b/src/virtManager/details.py
@@ -386,6 +386,7 @@ class vmmDetails(vmmGObjectUI):
"on_details_menu_view_scale_fullscreen_toggled": self.console.set_scale_type,
"on_details_menu_view_scale_never_toggled": self.console.set_scale_type,
+ "on_console_pages_switch_page": self.console.page_changed,
"on_console_auth_password_activate": self.console.auth_login,
"on_console_auth_login_clicked": self.console.auth_login,
})
@@ -1073,6 +1074,7 @@ class vmmDetails(vmmGObjectUI):
self.page_refresh(newpage)
self.sync_details_console_view(newpage == PAGE_DETAILS)
+ self.console.set_allow_fullscreen()
if newpage == PAGE_CONSOLE or newpage >= PAGE_DYNAMIC_OFFSET:
self.last_console_page = newpage
diff --git a/src/vmm-details.glade b/src/vmm-details.glade
index 325f3a064..2d69c27d6 100644
--- a/src/vmm-details.glade
+++ b/src/vmm-details.glade
@@ -515,7 +515,7 @@
0
0
0
-
+
True
@@ -524,6 +524,7 @@
0
0
0
+
True