rust-windowing / rust-windowing/winit

using set_title on another thread freeze window

Open
#2,179 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

C - needs investigation DS - win32
Dominant language
Rust
Stars
6.2k
Forks
1.3k
Avg merge
2d 19h
Merged PRs (30d)
9

Description

To Produce platform: windows

fn hello(window: Arc<Mutex<Window>>) {
    window.lock().unwrap().set_title("title");
}

fn add_hello_to_thread(system: fn(Arc<Mutex<Window>>), window: Arc<Mutex<Window>>) {
    thread::spawn(move || system(window))
}

fn to_do(window: Arc<Mutex<Window>>) {
    add_hello_to_thread(hello, window)
}

this code freeze the window. resize and other mutable functions work except set title it may get fixed replacing &str with String

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 by reproducing the provided Rust example on Windows, then trace the platform-specific implementation of Window::set_title and its thread requirements. Compare it with the mutable functions that work from another thread; done means updating the title from the spawned thread no longer freezes the window and the behavior is covered by an appropriate regression check.

Written by the indexing model from the issue text.

Assessment

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