-
-
Notifications
You must be signed in to change notification settings - Fork 313
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
Scale windows and resolution for HiDPI displays #2544
Closed
Closed
Commits on Feb 24, 2023
-
Make GLMakie aware of the content scale factor on HiDPI screens
This is accomplished by making the window and rendered framebuffer sizes independent of one another. By separating the two concepts, we can create rasterized graphics at higher (or lower) resolution than what is shown on screen. The window scale factor is used to scale the sizes of elements within the window (and on Linux and Windows, the window size itself from the requested logical sizes), and the px-per-unit scale factor dictates the size of the rasterized render. The default scaling factors are initialized by requesting the content scale factor from GLFW (and dynamically responding to changes in the content scale factor on platforms where GLFW provides support). Testing is added on Linux where xvfb-run can be used to force a HiDPI context.
Configuration menu - View commit details
-
Copy full SHA for 3b5110a - Browse repository at this point
Copy the full SHA 3b5110aView commit details -
Cleanup scalefactor/px_per_unit observables on close & resize on OSX
- Clear the `scalefactor` and `px_per_unit` observables when the figure is closed. It's possible both may be used during a figure's lifetime, but that should not persist past a close. - In the system scale factor callback, do not unconditionally resize the native window. Instead, leverage the fact that the observable callback will invoke a resize event, and that correctly will check that the root scene is not `nothing`. - Do not completely ignore the scale factor on OSX. The difference is that there is a native scaling factor applied by the OS, but if/when the desired scale factor differs from the native scaling, we must still make adjustments.
Configuration menu - View commit details
-
Copy full SHA for fe6d6cf - Browse repository at this point
Copy the full SHA fe6d6cfView commit details -
Replace window size polling with callback
Instead of polling for window size changes on every render tick, use the size-changed callback from GLFW to only make changes when it is known that there's been a change in the size of the window. This solves a concurrency problem that can happen when the scale factor is changed. The sequence of events looks like: 1. The `screen.scalefactor[]` value is changed 2. The listeners to `scalefactor` start to be notified. 3. Asynchronously, the `WindowAreaUpdater` listener attached to the `render_tick` observable runs. 4. The window area listener notices that the window size given the _new_ value of the scale factor doesn't match the scene size, so it updates the scene size. 5. The `scalefactor` listener responsible for resizing the window gets its slice of time to run, and it now sees that everything is already the "correct" size. Therefore, the window is not resized, and instead the scene size is rescaled in the opposite direction of the scale factor change.
Configuration menu - View commit details
-
Copy full SHA for 5ba035c - Browse repository at this point
Copy the full SHA 5ba035cView commit details
Commits on Mar 21, 2023
-
Configuration menu - View commit details
-
Copy full SHA for 006e050 - Browse repository at this point
Copy the full SHA 006e050View commit details
Commits on Mar 31, 2023
-
Configuration menu - View commit details
-
Copy full SHA for 902d047 - Browse repository at this point
Copy the full SHA 902d047View commit details -
Configuration menu - View commit details
-
Copy full SHA for 84b34d8 - Browse repository at this point
Copy the full SHA 84b34d8View commit details
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.