From 70a5cb7b550e13b50e19f5170cdbab723f0b1f63 Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Thu, 27 Aug 2020 08:11:54 -0400 Subject: [PATCH] gfxdetails: Improve UI interaction with spice GL + rendernode * Unset rendernode when spicegl is de-selected * Set rendernode by default when spicegl is first selected Signed-off-by: Cole Robinson --- virtManager/device/gfxdetails.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/virtManager/device/gfxdetails.py b/virtManager/device/gfxdetails.py index 07df108f4..13ba7367a 100644 --- a/virtManager/device/gfxdetails.py +++ b/virtManager/device/gfxdetails.py @@ -133,6 +133,8 @@ class vmmGraphicsDetails(vmmGObjectUI): self.widget("graphics-password").set_text("") self.widget("graphics-password").set_sensitive(False) self.widget("graphics-password-chk").set_active(False) + self.widget("graphics-opengl").set_active(False) + self._sync_opengl_ui() def get_values(self): gtype = uiutil.get_list_selection(self.widget("graphics-type")) @@ -146,6 +148,8 @@ class vmmGraphicsDetails(vmmGObjectUI): gl = self.widget("graphics-opengl").get_active() rendernode = uiutil.get_list_selection(self.widget("graphics-rendernode")) + if not self.widget("graphics-rendernode").get_visible(): + rendernode = None return gtype, port, listen, addr, passwd, gl, rendernode @@ -261,11 +265,15 @@ class vmmGraphicsDetails(vmmGObjectUI): self._show_rows_from_type() self.emit("changed-listen") - def _change_opengl(self, ignore): + def _sync_opengl_ui(self): uiutil.set_grid_row_visible( self.widget("graphics-rendernode"), self.widget("graphics-opengl").get_active()) + + def _change_opengl(self, ignore): + self._sync_opengl_ui() self.emit("changed-opengl") + self.emit("changed-rendernode") def _change_port_auto(self, ignore): self.widget("graphics-port-auto").set_inconsistent(False)