virt-manager: Don't clear all page visibilities during initialization

Since commit dfa23765, page_changed() sets page visibilities based on the
value of the newpage parameter. Calling the function without it being set
makes all pages invisible at once during initialization, resulting in a
weird scenario which prevents the window from getting proper focus events
when another window partially overlaps it, resulting in stuck grabs.
Message-Id: <55114787.6070401@canonical.com>
This commit is contained in:
Marc Deslauriers 2015-03-24 07:16:23 -04:00 committed by Cole Robinson
parent cfe9e7dc7e
commit 8574eedd2e
1 changed files with 4 additions and 3 deletions

View File

@ -1095,9 +1095,10 @@ class vmmConsolePages(vmmGObjectUI):
def page_changed(self, ignore1=None, ignore2=None, newpage=None):
pagenum = self.widget("console-pages").get_current_page()
for i in range(self.widget("console-pages").get_n_pages()):
w = self.widget("console-pages").get_nth_page(i)
w.set_visible(i == newpage)
if newpage is not None:
for i in range(self.widget("console-pages").get_n_pages()):
w = self.widget("console-pages").get_nth_page(i)
w.set_visible(i == newpage)
if pagenum < CONSOLE_PAGE_OFFSET:
self.last_gfx_page = pagenum