Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Undecorated window #233

Closed
wants to merge 2 commits into from
Closed

Conversation

bazsi
Copy link

@bazsi bazsi commented Mar 10, 2021

virt-manager: implement undecorated window mode

I have a 4k monitor and I have a VM that uses 1920x1080 resolution, which
I would like to lay out in the top-right corner of my monitor.

The problem is that as long as the window decoration, menubar and toolbar
is visible, 1920x1080 does not fit in the 1/4th of my monitor.

Also, the current virtual VGA driver for Windows does not support
non-standard resolutions like VirtualBox, thus I am either seeing a lot of
"black" space around my virtual desktop, or I would have to increase
the size of my virt-manager window.

None of this is appealing, so this patch implements a "windowed" full screen
mode, which is basically an undecorated window, without a menu or toolbar.

The same overlay is available at the top of the window than what is available
in full screen.

This is in preparation for a more involved UI logic change where the size of
the window needs to be decoupled from the "full-screen" mode of the console.

Signed-off-by: Balazs Scheidler <bazsi77@gmail.com>
I have a 4k monitor and I have a VM that uses 1920x1080 resolution, which
I would like to lay out in the top-right corner of my monitor.

The problem is that as long as the window decoration, menubar and toolbar
is visible, 1920x1080 does not fit in the 1/4th of my monitor.

Also, the current virtual VGA driver for Windows does not support
non-standard resolutions like VirtualBox, thus I am either seeing a lot of
"black" space around my virtual desktop, or I would have to increase
the size of my virt-manager window.

None of this is appealing, so this patch implements a "windowed" full screen
mode, which is basically an undecorated window, without a menu or toolbar.

The same overlay is available at the top of the window than what is available
in full screen.

Signed-off-by: Balazs Scheidler <bazsi77@gmail.com>
@bazsi
Copy link
Author

bazsi commented Mar 10, 2021

This adds a feature described here: https://bugzilla.redhat.com/show_bug.cgi?id=1091311#

@crobinso
Copy link
Member

Thanks for the patches but I'm sorry I don't think we should carry this in virt-manager. Per DESIGN.md I consider this Advanced Usage, and specifically it violates the section on Advanced VNC/SPICE usage, and there's already a reference there to previously rejecting undecorated windows. I will update that document with the menu bar example too.

There may be other options though:

  • windows + qxl video + spice agent does in fact allow arbitrary guest resolutions. I just confirmed with windows 10. Install virtio-win-guest-tools.exe and then in virt-manager select View->Scale Display->Autoresive VM to window, adjust your window to be the desired size, and the OS will be adjusted to match. You won't get 1920x1080 specifically but the window will fit wherever you want it.

  • Simpler but less nice looking: enable View->Scaling->Always. Now your VM has 1920x1080 resolution but in your space it will be vertically scaled down a bit. Should still be plenty usable

  • For window decorations, there's various external options to hide the title bar from outside the app. xprop and wmctrl like described here worked for me on gnome 3 on x11. I don't know if there's a way to do this with wayland.

  • There's not really any way to hide the menu bar that I know of though, sorry.

@crobinso crobinso closed this Mar 10, 2021
@JOJ0
Copy link

JOJ0 commented Oct 28, 2021

Hi @crobinso,
I'd like to use virt-viewer for a Linux VM, Debian 11 to be specific. Is there a Spice package/virtio package I have to install to get the VM resize together with the host window?
Thanks and sorry for hijacking this issue, not sure where to ask support questions like that.

I googled a little and found out that the Debian spice packages are called spice-vdagent and qemu-guest-agent.
I installed them and checked if the systemd services are properly running. They are, but VM resolution is not changing when I resize my virt-viewer window :-(

Any hints what I might be missing?

@hockeymikey
Copy link

@crobinso What a garbage decision. Who the heck cares about some rigid rules, the user comes first and foremost. Giving the user freedom to decide and use software how best fits them needs to be upheld and championed.

@JOJ0
Copy link

JOJ0 commented Nov 21, 2021

@hockeymikey Stayin juuust a little more polite might have be the better option, don't you think?

@hockeymikey
Copy link

@JOJ0 No, I don't think so.

@busywhistling
Copy link

@bazsi thanks for the PR! I was trying to make this work by building your fork, but couldn't see an Undecorated Window option in the menu. Could you please point me to how I could make this work? (Also since the time you wrote it, v4 of virt-manager is out and I suspect your commits can be integrated with minimal effort. I'd like to look at it, once I make it work for the earlier version)

@bazsi
Copy link
Author

bazsi commented May 15, 2022

Well, it's been a long while since I submitted this. Checking out the source there should be a menu item in the top-level menu at right after "Fullscreen" that should toggle the new mode.

To install it I didn't remember having to do too much things, I think I used "setup.py install" to a custom prefix and started from there.

slow-boat pushed a commit to slow-boat/virt-manager that referenced this pull request Oct 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants