Replies: 2 comments
-
You may want a secondary thread that runs separately from the UI thread. Here by separately I suggest that, in whatever case, the secondary thread should not be blocked by the UI thread, e.g, if the secondary thread wants to send something to the UI thread, nonblocking methods on nonblocking channels should be used. |
Beta Was this translation helpful? Give feedback.
-
In case someone comes across this still (like I did just now! Thank you!), I'd like to mention putting |
Beta Was this translation helpful? Give feedback.
-
I'm writing a messaging app, the app manages a websocket connection (ewebsock) from the update() function. I need to run in continuous mode in order to handle messages even when the application is not active (no focus, no UI activities, window in background or minimized). I understood I can achieve this behavior calling
egui::Context::request_repaint()
fromApp::update()
function.The problem is it works exactly as expected only on Windows, I've tested it on Windows 10 and 11, but it doesn't work on Linux, I've tested it on Ubuntu 22.04.
On Linux the
App::update()
function isn't called when there is no UI activity or window is minimized or in background.I've replicated it in the eframe template app adding these three lines ad the end of the
update()
:On Windows 10 and 11 it works fine, you can see the uninterrupted stream of
println()
on the console even when the window is minimized or in background.On Linux the printing freezes as soon there is no focus on the window or you put it in background.
Is there something I should do or know to achieve the expected behavior for a Linux target?
Beta Was this translation helpful? Give feedback.
All reactions