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

Sugarloaf examples do not render correctly on Linux #50

Closed
Cthutu opened this issue May 25, 2023 · 11 comments
Closed

Sugarloaf examples do not render correctly on Linux #50

Cthutu opened this issue May 25, 2023 · 11 comments
Labels
bug Something isn't working
Milestone

Comments

@Cthutu
Copy link

Cthutu commented May 25, 2023

I am using the latest Pop_OS! distribution and tried to run the sugarloaf example "text.rs". I hit 2 issues:

  • It render incorrectly:
    image

  • Maximising or resizing the window did not cause a redraw so the extra space was not rendered to. This means on a tiling window manager, nothing was rendered at all (perhaps off window?).

@Cthutu
Copy link
Author

Cthutu commented May 25, 2023

This is the result of the rect.rs example. I am not sure if it's correct:
image

It also suffers from resizing problems.

@raphamorim
Copy link
Owner

Hey there @Cthutu , yes I am aware (unfortunately). Same behaviour happens in the macos when having an external monitor with a scale factor different than 2.0. The initial render of sugarloaf has a hardcoded logic to start calculating layouts with 2.0, this need to be fixed.

Rect is the only case that's correct because doesn't the scale calculation.

@raphamorim
Copy link
Owner

I plan to look on that soon, but feel free to send a PR as well 🙏

@raphamorim
Copy link
Owner

BTW same happens to Rio in macos when using external monitor with 1.0 scale factor.

image

@raphamorim raphamorim added the bug Something isn't working label May 25, 2023
@raphamorim raphamorim added this to the 0.0.5 milestone May 25, 2023
@raphamorim
Copy link
Owner

Hey @Cthutu pushed a correction for those issues in 3b482ff. Please pull latest main and check if still happens.

I will close this issue after validate the fix with @filaruina

@Cthutu
Copy link
Author

Cthutu commented May 26, 2023

Your changes fixes the first issue (woohoo!). However, it doesn't render correctly on a tiled window manager (the window opens at the usual size then immediately gets resized and repositioned by the desktop manager) or when you resize the window (e.g. maximising). I think this is just because you don't redraw on resize in the demo? I haven't had enough time lately to get to the bottom of it.

@raphamorim
Copy link
Owner

Yes, that's "expected" (not a bug) in demo since it only listen to ScaleFactor updates but is ignoring resize events without scale factor updates. Would be good to add it to the examples.

Also, I think it happens the same for rect case when happens a resize:

Screenshot 2023-05-26 at 09 59 53

For now I will close this issue but feel to update the examples 🙏

Other thing to take in consideration is the examples are using fixed LogicalSize, idk how it behaves in Linux (considering test PhysicalSize instead)

@Cthutu
Copy link
Author

Cthutu commented May 26, 2023

If you want pixel perfect you should be using PhysicalSize. If you want to take into account the user's settings for monitor scale factors etc, LogicalSize is your friend.

@raphamorim
Copy link
Owner

Yea, I like LogicalSize for the terminal as an user application but thinking in enable it as configuration option, then you can choose what fits better for your case.

@filaruina
Copy link

BTW same happens to Rio in macos when using external monitor with 1.0 scale factor.

image

This is fixed for me using main version. Running on ubuntu

@raphamorim
Copy link
Owner

Great, thank you @filaruina for testing it too !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants