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

fix: Change how window resize detection works #1458

Merged

Conversation

chipbuster
Copy link
Contributor

@chipbuster chipbuster commented Aug 5, 2022

What kind of change does this PR introduce?

  • Fix

Did this PR introduce a breaking change?

A breaking change includes anything that breaks backwards compatibility either at compile or run time.

  • No

Changes how the detection of window resizing works. Previously relied
on hardcoded 800 x 600 value, which was not always correct on MacOS, or
rescaling by the scaling factor, which was not always correct on Linux.

The physical size of the window is now stored right after the window is
initialized, and this value is used whenever we check for window
resizing.

I have tested this with WINIT_X11_SCALING_FACTOR set to 0.8, 1.0,
1.5, 2.0, and 2.1, and observed seemingly-correct behavior on Linux,
(appropriate response to --geometry flag, no panics), so I believe
that this closes a number of scaling bugs. I also have a Macbook on
which I was able to reproduce #1216, and this PR does not cause a
regression of behavior on that system.

Closes #1450
Closes #1384
Closes #1307
Does not regress #1216

One potential perf issue is the presence of self.windowed_context.window().inner_size()
in draw_frame(). I'm hoping that the optimizer will be able to inline
and eliminate this call, but if we're worried about it, I can change
the implementation.

Changes how the detection of window resizing works. Previously relied
on hardcoded 800 x 600 value, which was not always correct on MacOS, or
rescaling by the scaling factor, which was not always correct on Linux.

The physical size of the window is now stored right after the window is
initialized, and this value is used whenever we check for window
resizing.
@MultisampledNight
Copy link
Contributor

Awesome, thank you!

@MultisampledNight MultisampledNight merged commit 324a02b into neovide:main Aug 6, 2022
@chipbuster chipbuster deleted the fix-window-resize-detection branch August 6, 2022 17:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants