Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
Please login to access the resource
SUSE:SLE-12-SP1:Update
virt-manager.12547
eea9b276-fix-resize-to-vm-action.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File eea9b276-fix-resize-to-vm-action.patch of Package virt-manager.12547
References: bsc#955924 Subject: console: Fix and simplify 'Resize to VM' action From: Cole Robinson crobinso@redhat.com Thu May 19 18:27:35 2016 -0400 Date: Fri May 20 11:44:18 2016 -0400: Git: eea9b27696768fdde892259168e39b7a3f50738c We need to resize the window and not try to play crazy games with the scroll window size. Wish I realized this years ago... Index: virt-manager-1.2.1/virtManager/console.py =================================================================== --- virt-manager-1.2.1.orig/virtManager/console.py +++ virt-manager-1.2.1/virtManager/console.py @@ -50,7 +50,6 @@ class vmmConsolePages(vmmGObjectUI): self._pointer_is_grabbed = False self._change_title() self.vm.connect("state-changed", self._change_title) - self._force_resize = False # State for disabling modifiers when keyboard is grabbed self._accel_groups = Gtk.accel_groups_from_object(self.topwin) @@ -282,8 +281,9 @@ class vmmConsolePages(vmmGObjectUI): ########################### def _scroll_size_allocate(self, src_ignore, req): - if (not self._viewer or - not self._viewer.console_get_desktop_resolution()): + if not self._viewer: + return + if not self._viewer.console_get_desktop_resolution(): return scroll = self.widget("console-gfx-scroll") @@ -296,27 +296,24 @@ class vmmConsolePages(vmmGObjectUI): # pylint: disable=unpacking-non-sequence desktop_w, desktop_h = self._viewer.console_get_desktop_resolution() - if desktop_h == 0: - return desktop_ratio = float(desktop_w) / float(desktop_h) - if is_scale or self._force_resize: + if is_scale: # Make sure we never show scrollbars when scaling scroll.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.NEVER) else: scroll.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC) - if not self._force_resize and is_resizeguest: + if is_resizeguest: # With resize guest, we don't want to maintain aspect ratio, # since the guest can resize to arbitrary resolutions. self._viewer.console_set_size_request(req.width, req.height) return - if not is_scale or self._force_resize: + if not is_scale: # Scaling disabled is easy, just force the VNC widget size. Since # we are inside a scrollwindow, it shouldn't cause issues. - self._force_resize = False self._viewer.console_set_size_request(desktop_w, desktop_h) return @@ -383,10 +380,14 @@ class vmmConsolePages(vmmGObjectUI): if not self._viewer.console_get_desktop_resolution(): return + topwin_alloc = self.topwin.get_allocation() + viewer_alloc = self.widget("console-gfx-scroll").get_allocation() + desktop_w, desktop_h = self._viewer.console_get_desktop_resolution() + self.topwin.unmaximize() - self.topwin.resize(1, 1) - self._force_resize = True - self.widget("console-gfx-scroll").queue_resize() + self.topwin.resize( + desktop_w + (topwin_alloc.width - viewer_alloc.width), + desktop_h + (topwin_alloc.height - viewer_alloc.height)) ################ Index: virt-manager-1.2.1/virtManager/viewers.py =================================================================== --- virt-manager-1.2.1.orig/virtManager/viewers.py +++ virt-manager-1.2.1/virtManager/viewers.py @@ -229,7 +229,14 @@ class Viewer(vmmGObject): return self._get_grab_keys() def console_get_desktop_resolution(self): - return self._get_desktop_resolution() + ret = self._get_desktop_resolution() + if not ret: + return ret + + # Don't pass on bogus resolutions + if (ret[0] == 0) or (ret[1] == 0): + return None + return ret def console_get_scaling(self): return self._get_scaling()
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor