slint icon indicating copy to clipboard operation
slint copied to clipboard

`slint::ComponentHandle::run` returns when `on_close_requested` callback completes

Open radiohertz opened this issue 1 year ago • 1 comments

I was looking to crate a system tray thing for my application and i couldn't because of this issue. even slint::ComponentHandle::hide makes slint::ComponentHandle::run return.

Example

https://gist.github.com/qw0rd/b9e86a99129b31e502bd9e45d146a84e

radiohertz avatar Aug 18 '22 06:08 radiohertz

There is internal API which we use for the LSP preview (EventLoopQuitBegiavior) https://docs.rs/i-slint-core/latest/i_slint_core/backend/trait.Backend.html#tymethod.run_event_loop

We should somehow expose a way to keep the event loop alive when there are no window.

I guess, in the mean time, you could try to re-run the event loop after it quits

ogoffart avatar Aug 18 '22 08:08 ogoffart