Multiple windows - Message Loop blocking the main thread #734
Unanswered
antoinem60
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I'm building an app that requires to create many small windows as 'overlays'. Basically, I'm making a HUD (Head up display) for another software. Here is what my app looks like : Image. I need to create many small windows like the one on the left of the image. Theses windows must be frameless, movable, always on top and should not appear in the taskbar/alt+tab.
From what I know, Flutter doesn't really allow to create such windows. This is why I tried to use the win32 package. Here is my code :
My problem is that there is a infinite loop for the window Message Loop and this loop is blocking the main thread (the app main window).
How can I create several windows like this one and avoid blocking the main window ?
I tried to run the message loop into an Isolate but the window doesn't respond (I guess because Isolates are not sharing memory but not sure). I tried to put the whole function (window creation + message loop) into an Isolate, it worked. The main window wasn't blocked anymore and the HUD window was displaying correctly. But I also need to update the texts displayed on the HUD window, for this I tried to use communication between Isolates but somehow the Listen Stream is never reached. Here is the code :
Any idea on how to create many non-blocking windows like that ? From all the examples I've found in the package, there is always only one window and a blocking message loop at the end of the main function.
Any help will be very much appreciated !
Beta Was this translation helpful? Give feedback.
All reactions