Small issues in the pure_glow example
- Dominant language
- Rust
- Stars
- 30.6k
- Forks
- 2.1k
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 67
Description
**Describe the bug**
My laptop is running Windows 11 with a high DPI screen, and I noticed some small issues with the pure_glow example:
- The scale_factor was not applied, so the example GUI was very tiny
- Noticeable flickering when resizing the window
**To Reproduce**
Steps to reproduce the behavior:
1. Run the pure_glow example
2. Resize the window rapidly
3. Adjust the Windows scale factor
**Expected behavior**
GUI should ideally obey OS scaling and avoid flickering when window is being resized
**Screenshots**
https://github.com/emilk/egui/assets/12837524/2d92045b-621d-4970-b4be-22764eaecac0
**Desktop (please complete the following information):**
- OS: Windows 11
**Additional context**
I fixed these issues in my own fork already, so I can open a PR if you want. They appear to be working fine, but I'm not an expert with native GUI stuff, so it may have some implications that I'm not aware of (in which case, I'd love some feedback on how to fix it properly!).
https://github.com/awestlake87/egui
Summary of the fixes
- Called `set_pixels_per_point` on egui context during initialization and scale factor change event
- Called `redraw` directly when processing window events instead of using `request_redraw` in order to avoid small delay between window resize and repaint (root cause of the flickering)
- Refactored `redraw` to pass `egui_glow` and `control_flow` through parameters to satisfy borrow checker.
- Had to add a control_flow check before redraw in window event handler since the changes broke the window close button.
Contributor guide
Assessment
This issue has not been assessed yet.