-
Notifications
You must be signed in to change notification settings - Fork 39
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
Wrong units comparison when deciding on initial window size #56
Comments
Thanks I think the logic for window size compute need a little bit more love. The rust branch is really really WIP, I didn't do much on it during summer. |
Compute maximum width and height of area container based on monitor size and fix image ratio based on appropriate values. Note that this will lower the resolution of the final image. Closes #56
@maximbaz I reworked the initialization of the window and cairo surfaces. It should fix this issue but might make #54 more perceivable. I've tried on various image sizes (big heights, big widths) and scaled monitor. The window seems to have the proper size now. Can you try to build the |
Thanks for working on this! It seems I am still able to reproduce the issue 😞 Here's the image I'm using as a test (archived to make sure github doesn't do anything to it): image.zip Here are the logs:
And here's how it actually looks on my screen, you can see only maybe 1/3 of the image fits the screen and everything is oversized... This part is probably wrong: My screen resolution is |
Compute maximum width and height of area container based on monitor size and fix image ratio based on appropriate values. Note that this will lower the resolution of the final image. Closes #56
I think I've got it 🤞 Can you try to |
It's... different now 🙂 The window is not oversized, it fits the screen completely... but you are right, #54 is much more perceivable now 😞 Could you explain why is this the case, if you know already? Also interestingly enough it is not 1:1 with reality, I expected to see the image inside swappy scaled exactly as reality, but here is me moving swappy right under waybar and you can see that stuff inside swappy is smaller: And another interesting observation is that if I open an image with swappy and click "save", the saved image will be different in size!
|
All 3 issues you are mentioning are all related to #54. Now the window (or However because the final image (saved or copied) is taken from that So in the end swappy lowers the resolution of the rendered buffer. This is not great and I need to find a clever way to fix that without re-writing the rendering pipeline. It looks like this particular issue is fixed, I will probably merge it to master soon and see what I can do for #54. |
Sounds good, thank you! |
Compute maximum width and height of area container based on monitor size and fix image ratio based on appropriate values. Note that this will lower the resolution of the final image. Closes #56
Compute maximum width and height of area container based on monitor size and fix image ratio based on appropriate values. Note that this will lower the resolution of the final image. Closes #56
Compute maximum width and height of area container based on monitor size and fix image ratio based on appropriate values. Note that this will lower the resolution of the final image. Closes #56
Compute maximum width and height of area container based on monitor size and fix image ratio based on appropriate values. Note that this will lower the resolution of the final image. Closes jtheoof#56
Hi again 🙂
I'm on HiDPI screen (scaling factor 2.5), and I noticed that sometimes the window size is completely off, like the height of swappy window would be two times bigger than the height of my screen.
Turns out this is caused by comparing different units when deciding on window size.
swappy/src/application.c
Lines 555 to 569 in f3a4ae9
My screen is
3840x2400px
. I'm opening a1237x2397px
image withswappy -f image.png
and here's what is logged:Size of image is used as-is, while size of monitor is divided by scale value of
2.5
, so comparing those values is wrong.As you can imagine, swappy window is now
2232*2.5=5580px
in height!I wasn't sure which way is proper to fix the issue, but I hope this gives you enough information to come up with a quick patch.
Thanks!
P.S. Have I already mentioned how awesome your tool is? It is! 😄
P.P.S. Excited about your rust refactoring branch 😉
The text was updated successfully, but these errors were encountered: