Skip to content

Conversation

@jgmdev
Copy link
Member

@jgmdev jgmdev commented Aug 27, 2024

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...)

Now besides updating scale on displaychanged event it also updates
it when the window is resized.

Forgot to adjust this code for v3.4.3 :(
jgmdev added 2 commits August 27, 2024 17:44
This ensures that the system scale is set before performing
any style calculations that rely on current scale.

Also, prevent fetching the system scale on window resize too rapidly
to prevent crashes on X11.

Re-adjusted scale plugin for these changes.
@jgmdev jgmdev changed the title Adjust core scaling to newest scale plugin changes Adjust scale retrieveal on startup Aug 27, 2024
@jgmdev jgmdev merged commit 9a0aca2 into pragtical:master Aug 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant