-
Notifications
You must be signed in to change notification settings - Fork 1
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
Screencopy.grab_screenshot
uses logical size for the resulting image
#142
Comments
Apparently this doesn't affect the Nvidia platform, so the different eglstream screenshotting code path yields the correct result. Except for the fact that |
What does grim do?
So then how do we determine the size of the final image?
When |
How does it then end up with the correct resolution on Nvidia, when we seem to be giving screenshots of output, not logical, geometry? 🤷 |
What does mir-ci do
|
Just brain dumping FYI. Time to track down where Nvidia goes different |
There is no reason why the size should be any different on Nvidia as far as I can tell. The code path gets the resolution divided by the scale in both instances, and that result is exactly the same regardless of the platform. Maybe I'm missing something but there aren't two different code paths there. Of course configuration is two code paths, but the result is still the same if they are configured to be the same value |
At the end of the day, Do we want to do a similar thing in mir-ci @Saviq? Technically our result isn't wrong, since that's the actual size of the buffer 🤷 |
This is just… why would you want a scaled down shot and then scale it up… I've not seen anything in the screencopy proto that says what scale should the image be… but why would you want it scaled down… |
Maybe What if we give it real size shots? Then, there's other users of that protocol… And then then… how does @tarek-y-ismail get real size screenshots on his HW‽ |
wlr screencopy wants to send down an unscaled buffer (so it seems - this is not explained outright). Therefore, it is up to the client to present that buffer in some way. That way technically doesn't have to be defined by the protocol since the interpretation of that buffer happens outside of the protocol. With that being said, I think that the correct course of action on our end is to accept the fact that we have non-real sized shots, and then scale things up on the client side if we want to display them scaled. |
Unscaled is physical resolution in my dictionary… You mean screen copy wants logical geometry?… |
Okay I was very confused. I still don't know why it's scaled in CI, because the size that's being reported is indeed the physical size (gotten from the current mode). I was mistaken in that regard |
Hum. This gives you native size on both Nvidia and Intel? In [1]: from mir_ci.tests.robot.platforms.wayland.Screencopy import Screencopy
2024-08-06 11:01:59,666 - RPA.core.certificates - INFO - Truststore not in use, HTTPS traffic validated against `certifi` package. (requires Python 3.10.12 and 'pip' 23.2.1 at minimum)
In [2]: sc = Screencopy()
In [3]: sc._screenshots_dir="/tmp"
In [4]: await sc.grab_screenshot()
Out[4]: (1, <PIL.Image.Image image mode=RGBA size=400x300>) |
@tarek-y-ismail Just found out that in CI we really do get the logical size sent down as the image size instead of the physical size. I still get the physical size 🤷 I am going to do some more investigations right now, but it's looking strange |
I have reproed on the Github Runner! Time to find out why :) |
Wait a gosh darn minute... I rebuilt it locally, and it works properly in both |
Well, not wrong, but stable… and canonical/mir#3474 is what fixed this, not on stable yet. #145 adds testing on the latest version of Mir. |
grim
does things right:$ WAYLAND_DISPLAY=wayland-1 miral-shell --display-scale=2 --add-wayland-extension all --x11-output 800x600 & $ WAYLAND_DISPLAY=wayland-1 grim foo.png $ file foo.png foo.png: PNG image data, 800 x 600, 8-bit/color RGBA, non-interlaced
But
Screencopy.grab_screenshot()
does not scale:The text was updated successfully, but these errors were encountered: