mirror of
https://github.com/virt-manager/virt-manager.git
synced 2024-12-22 13:34:07 +03:00
vmwindow: Default the console widget to 1024x768
When a VM window is launched for the first for a VM, currently we set the top window size to 800x600 which is small and arbitrary and is universally shrinks the viewer too much to fit any OS installer I can find. Instead do some hacks to resize the window to accomodate a viewer widget of 1024x768 which seems to be what QXL graphics give us for win10 and Fedora 32 installers. So for new VMs hitting the OS installer we don't see scrollbars. Signed-off-by: Cole Robinson <crobinso@redhat.com>
This commit is contained in:
parent
43512302f7
commit
bbbfd4b7c8
@ -103,15 +103,14 @@ class VMMPrefs(uiutils.UITestCase):
|
||||
xmleditor = detailswin.find("XML editor")
|
||||
|
||||
detailswin.find("XML", "page tab").click()
|
||||
uiutils.drag(detailswin, 400, 400)
|
||||
warnlabel = detailswin.find_fuzzy("XML editing is disabled")
|
||||
uiutils.check(lambda: warnlabel.visible)
|
||||
origtext = xmleditor.text
|
||||
xmleditor.typeText("1234abcd")
|
||||
uiutils.check(lambda: xmleditor.text == origtext)
|
||||
|
||||
managerwin.click_title()
|
||||
managerwin.grabFocus()
|
||||
managerwin.click()
|
||||
managerwin.find("Edit", "menu").click()
|
||||
managerwin.find("Preferences", "menu item").click()
|
||||
prefswin = self.app.root.find_fuzzy("Preferences", "frame")
|
||||
|
@ -83,11 +83,10 @@ class vmmVMWindow(vmmGObjectUI):
|
||||
|
||||
# Set default window size
|
||||
w, h = self.vm.get_details_window_size()
|
||||
if w <= 0:
|
||||
w = 800
|
||||
if h <= 0:
|
||||
h = 600
|
||||
self.topwin.set_default_size(w, h)
|
||||
if w <= 0 or h <= 0:
|
||||
self._set_initial_window_size()
|
||||
else:
|
||||
self.topwin.set_default_size(w, h)
|
||||
self._window_size = None
|
||||
|
||||
self._shutdownmenu = None
|
||||
@ -190,6 +189,24 @@ class vmmVMWindow(vmmGObjectUI):
|
||||
return
|
||||
self.emit("customize-finished", self.vm)
|
||||
|
||||
def _set_initial_window_size(self):
|
||||
"""
|
||||
We want the window size for new windows to be 1024x768 viewer
|
||||
size, plus whatever it takes to fit the toolbar+menubar, etc.
|
||||
To achieve this, we force the display box to the desired size
|
||||
with set_size_request, wait for the window to report it has
|
||||
been resized, and then unset the hardcoded size request so
|
||||
the user can manually resize the window however they want.
|
||||
"""
|
||||
w = 1024
|
||||
h = 768
|
||||
hid = []
|
||||
def win_cb(src, event):
|
||||
self.widget("details-pages").set_size_request(-1, -1)
|
||||
self.topwin.disconnect(hid[0])
|
||||
self.widget("details-pages").set_size_request(w, h)
|
||||
hid.append(self.topwin.connect("configure-event", win_cb))
|
||||
|
||||
def _vm_removed_cb(self, _conn, vm):
|
||||
if self.vm == vm:
|
||||
self.cleanup()
|
||||
|
Loading…
Reference in New Issue
Block a user