slint-ui / slint

Slint is a declarative GUI toolkit to build native user interfaces for Rust, C++, or JavaScript apps.
https://slint.dev
Other
17.67k stars 611 forks source link

esp-idf: Add a semaphore in the SlintPlatformConfiguration #6685

Closed ogoffart closed 3 weeks ago

ogoffart commented 3 weeks ago

The semaphore is going to be locked the whole time when Slint is doing stuff.

CLAassistant commented 3 weeks ago

CLA assistant check
All committers have signed the CLA.

ogoffart commented 3 weeks ago

@eidetech The unlock in the if (m_window->window().has_active_animations()) was clearly needed, well spotted, but now the semaphore is no longer locked when doing the actual rendering in the buffer, only It is only locked as it waits for the vsync interrupt, and swap the buffers. And it will deadlock if there is nothing to draw.

eidetech commented 3 weeks ago

@ogoffart Good catch. Could it be solved by moving the semaphore take to before if (std::exchange(m_window->needs_redraw, false)) {?

ogoffart commented 3 weeks ago

This is not needed after all