aui-framework / aui-framework/aui
Windows: hovering vertical scrollbar thumb at 120% DPI continuously shrinks the window
- Dominant language
- C++
- Stars
- 598
- Forks
- 44
- Avg merge
- 17h 56m
- Merged PRs (30d)
- 3
Description
### One More Step Before opening this issue
- [x] To follow our [Code of Conduct](https://github.com/aui-framework/aui/blob/master/CODE_OF_CONDUCT.md)
- [x] I've considered [existing issues on GitHub page](https://github.com/aui-framework/aui/issues) and didn't find a similar issue
### What happened?
On Windows with display scaling set to **120%**, moving the mouse over the **thumb** of the **vertical scrollbar on the right side of the main window** causes the window to **keep shrinking**.
This happens while hovering the scrollbar handle (`AScrollbarHandle`); the window size then decreases continuously instead of staying stable.
This looks distinct from #58 (window size changing when moving between monitors with different DPI). #744 (`windows: hotfix initial dpi`) also does not appear to cover this hover case.
Possible related code (not confirmed as the root cause):
- `AWindow::redraw()` on Windows clamps the window size when min content size is invalidated:
```cpp
#if AUI_PLATFORM_WIN
setSize(glm::clamp(getSize(), getMinimumSize(), getMaxSize()));
#endif
```
- Hover styles on the scrollbar handle may invalidate min content size / layout. Combined with 120% DPI hit-testing, the pointer may stay over the handle (or the native resize border), producing a shrink loop.
### Relevant log output or stack trace
```shell
No crash or stack trace. The window resizes continuously while the pointer is over the vertical scrollbar thumb.
```
### Steps to reproduce
```bash
1. On Windows, set display scaling to 120% (Settings > System > Display > Scale).
2. Open `aui.example.views` (or any AUI window with a vertical scrollbar on the right edge of the main window).
3. Make the window small enough that the vertical scrollbar is visible.
4. Move the mouse onto the scrollbar thumb (the draggable handle), without clicking.
5. Observe: the main window keeps shrinking.
```
### Affected Platforms
Windows
### Link to build, i.e. failing GitHub Action job (if any).
_No response_
Contributor guide
Research direction
Start by reproducing the issue in aui.example.views on Windows at 120% scaling with a small window and a visible scrollbar. Read AWindow::redraw() and the AScrollbarHandle hover and layout paths, then trace min-content-size invalidation and resizing while the pointer remains over the thumb. Done means hovering the vertical scrollbar handle no longer causes continuous window shrinking.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- desktop
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100