linebender / linebender/druid

Be defensive against reentry on macOS

Open
#263 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

shell/mac
Dominant language
Rust
Stars
9.7k
Forks
565
PR merge metrics
No merged PRs in 30d

Description

In the druid-shell mac backend, we are currently very cavalier about casting the `ViewState` to `&mut ViewState`. It would be better if instead we stored something like a `RefCell`, and then to get a mutable reference had to go through the `borrow_mut` dance.

This is motivated by [discussion in zulip](https://xi.zulipchat.com/#narrow/stream/147926-druid/topic/druid-chatter/near/179954557), around #262.

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 in the druid-shell mac backend and inspect the ViewState casting described in the issue, then review the linked discussion around #262 for the reentry motivation. Evaluate storing ViewState in a RefCell and using borrow_mut for mutable access; done means the backend no longer relies on the current direct mutable cast and reentry is handled defensively.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
desktop
Issue type
Refactor
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.