Skip to content

Conversation

@srussvoll
Copy link

@srussvoll srussvoll commented Apr 10, 2025

I'm working on the bevy_iced plugin for Bevy that integrates Iced into Bevy:

Since Bevy is using pipelined rendering and Iced assumes non-pipelined rendering, some things don't work. For instance, when typing into a text input widget, the text will often disappear for a frame when a letter is typed resulting in blinking, and is reported in #2318. The issue is that there is a race between the renderer reading the weakly referenced text and the destroying of that text, and is described in more detail here: #2670 (comment). I started a thread in Discord to discuss this problem more generically.

This PR fixes the race condition that causes the flashing text.

The following PR is also required to get bevy_iced to work with the main branch of iced:

@srussvoll srussvoll changed the title Use strong reference when sending Paragraph and Editor to the ren… Fix race condition for Paragraph and Editor in the renderer Apr 10, 2025
@hecrj
Copy link
Member

hecrj commented Nov 25, 2025

This is planned, but it's unfortunately not as easy as cloning Arc.

Specifically, Editor assumes a unique strong owned reference:

// TODO: Handle multiple strong references somehow
let mut internal = Arc::try_unwrap(editor)
.expect("Editor cannot have multiple strong references");

We need to address those first while making sure that for the iced use case no cloning occurs.

@hecrj hecrj closed this Nov 25, 2025
@hecrj hecrj added this to the 0.14 milestone Nov 25, 2025
@hecrj hecrj added improvement An internal improvement rendering change labels Nov 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

change improvement An internal improvement rendering

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants