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

enhancement: have the vnc screen's canvas be the native resolution of the guest #1390

Open
breadtf opened this issue Jan 16, 2024 · 5 comments

Comments

@breadtf
Copy link

breadtf commented Jan 16, 2024

Having the canvas resolution be greater than that of the guest leads to the guest looking blurry. Removing the scaling (or at least adding the option to toggle it) makes the guest much sharper and clearer. It also allows the whole screen to be viewed on smaller devices.

Here is a before and after of the scaling off (using a css hack)

Before:
Screenshot_20240116_201154

After:
Screenshot_20240116_200941

The issue doesn't come across well on screenshots, but zooming in you can clearly see the pixels are way sharper.

Before:
Screenshot_20240116_201333

And after:
Screenshot_20240116_201415

@breadtf breadtf changed the title enhancement: have the canvas be the native resolution of the guest enhancement: have the vnc screen's canvas be the native resolution of the guest Jan 17, 2024
@garrett
Copy link
Member

garrett commented Jan 17, 2024

I agree! Optimizing for native resolution would be a good idea, especially when the host's resolution is less than the available space.

@breadtf
Copy link
Author

breadtf commented Jan 17, 2024

Had a look at react-console's source (which the vnc viewer uses) and saw this
image
This looks like what's causing this annoying scaling, and, sure enough, there it was
(in src/components/vm/consoles/vnc.jsx)
image
A quick and dirty fix could just be to remove this line, as by default it's set to false. I'll test this solution later today and I'll let you all know if it worked.

@garrett
Copy link
Member

garrett commented Jan 17, 2024

Thanks!

The details page for a VM does need scaling, as does any resolution that's larger than the viewport (so it'd need to be scaled down). So we cannot just change it to unscaled in these cases.

Would there be a way to scale down, but not scale up? That would probably handle most uses of the widget by default where it needs scaling and would probably sidestep the blurriness you're seeing.

@breadtf
Copy link
Author

breadtf commented Jan 17, 2024

Oh yeah, you're right. Completely forgot about that (Probably because I haven't used it)

That would probably involve creating an issue on react-console's github, as I doubt it would be possible here.
I'm not going to, though, because I'm not up for a wild goose chase trying to fix some minor issue. I'll just have to live with it for now and maybe make an issue later if it becomes more of a problem in future.

@breadtf breadtf closed this as completed Jan 17, 2024
@garrett
Copy link
Member

garrett commented Jan 18, 2024

I think this is a valuable point to consider, and if we leave the issue open, it could serve as a reminder when we're (eventually) working on implementing the redesign of the in-page VNC viewer.

And, besides, react-console was originally from Cockpit Machines, so we can (and should... and even plan to) change it.

Thanks again for pointing out this issue!

@garrett garrett reopened this Jan 18, 2024
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

No branches or pull requests

2 participants