Bug 1414718 - cannot resize the vm window smaller when "Alway" and "Auto resize VM with window" are active
Summary: cannot resize the vm window smaller when "Alway" and "Auto resize VM with win...
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Virtualization Tools
Classification: Community
Component: virt-manager
Version: unspecified
Hardware: x86_64
OS: Unspecified
medium
medium
Target Milestone: ---
Assignee: Cole Robinson
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-01-19 10:37 UTC by Xiaodai Wang
Modified: 2019-11-12 16:46 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-11-12 16:46:34 UTC
Embargoed:


Attachments (Terms of Use)
workaround (1.80 KB, patch)
2019-04-19 12:20 UTC, dav87legrand
no flags Details | Diff

Description Xiaodai Wang 2017-01-19 10:37:42 UTC
Description of problem:
cannot resize the vm window smaller when "Alway" and "Auto resize VM with window" are active.

Version-Release number of selected component (if applicable):
virt-manager-1.4.0-2.el7.noarch

How reproducible:
100%

Steps to Reproduce:
1. Prepare a running spice guest.
2. Activate "View->Scale Display->Always & Auto resize VM with window". 
3. Move the mouse cursor to the bottom right corner of the vm winodw.
4. Try to drag the window to top left and bottom right directions.

Actual results:
The vm window can only be resized larger and can't be resized smaller.

Expected results:
The vm window should be resized smaller when drag the window smaller.

Additional info:

Comment 2 Jaroslav Suchanek 2017-01-19 14:47:35 UTC
Well, I think this is expectable. But lets see what Pavel will say...

Comment 3 Pavel Hrdina 2017-02-08 16:33:42 UTC
Virt-viewer doesn't suffer with the same issue and it does scaling and auto-resizing by default so this is probably a bug in virt-manager.  Moving to upstream.

Comment 4 dav87legrand 2019-04-19 12:20:33 UTC
Created attachment 1556464 [details]
workaround

Hi,

The bug is still present.
Here is my workaround, maybe not the best but seems to work.

Comment 5 Florian Ludwig 2019-10-09 09:13:31 UTC
The workaround from dav87legrand works.


I looked into the code but could not figure out why:

```
        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
```

would not resize the window but

```
        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)
            viewer_alloc = Gdk.Rectangle()
            viewer_alloc.width = req.width
            viewer_alloc.height = req.height
            self._viewer.console_size_allocate(viewer_alloc)
            return
```

would.


How do we get this merged (or properly fixed by someone with more gtk knowledge :))?  Would a merge request on github help?

Comment 6 Cole Robinson 2019-11-12 16:46:34 UTC
Fixed upstream now by Florian: https://github.com/virt-manager/virt-manager/commit/ae19d6d6ec0b48085ce1c765fb2264e27fb51c63


Note You need to log in before you can comment on or make changes to this bug.