rust-windowing / rust-windowing/winit

macOS: (in window example) redundant redraw request during resizing

Open
#4,517 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

B - bug DS - appkit
Dominant language
Rust
Stars
6.2k
Forks
1.3k
Avg merge
2d 19h
Merged PRs (30d)
9

Description

Description

First off, you can observe this bug in the window example, but it probably applies to any consumer that requests a redraw on SurfaceResized. I noticed it while working on a different PR.
I think this might be because our drawRect override sends a redraw request every time the window bounds change, but so does the application after receiving WindowEvent::SurfaceResized. or AppKit just calls drawRect twice for some reason.

macOS version
ProductName:    macOS
ProductVersion: 12.7.6
BuildVersion:   21H1320
Winit version

master (0b6b794f012b5e82e0600cd4ed41f84f9fc76023)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the macOS window example and trace the drawRect override alongside handling of WindowEvent::SurfaceResized. Compare each path's redraw request during resizing, then verify the finished change no longer causes a redundant redraw while preserving the required resize redraw behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
macos, rust
Domain
desktop, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.