Adjust scale retrieveal on startup #152
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Since new renwindow api (that allows initializing windows directly Lua) the main window creation was moved to core.init but, the scale detection code was still been performed before. This meant that loading the default system style was using the incorrect scale causing issues that would only be resolved by manually re-scaling the interface.
Tried to wrongly fix the issue by delegating the responsibility to the scale plugin but that wasn't the correct solution (didn't notice what explained on first paragraph until later 😓). Now we defer style loading until main window is created and the default system scale properly detected, this ensures that the correct scale is set before performing any style calculations that rely on it.
Now besides updating scale on the displaychanged event it also updates it when the window is resized, but we limited the amount of scale checks on resize to prevent crashes on X11.
Hopefully this changes finally tackles the freaking scale issues 😄 (sorry to people at #34)
Forgot to adjust this code for v3.4.3 :((the issue was deeper than I initially thought, anyways what are releases for...)