[haiku-3rdparty-dev] Re: Dispatch messages
- From: waddlesplash <waddlesplash@xxxxxxxxx>
- To: haiku-3rdparty-dev@xxxxxxxxxxxxx
- Date: Sat, 19 Nov 2022 15:47:09 -0500
On Sat, Nov 19, 2022 at 3:27 PM Carlo Lanzotti <clanzotti@xxxxxxxxxxxxx> wrote:
Now, at some point, inside the my_message_queue_handling(), a modal window
may be requested (my window, not an OS one) and I need to run a local loop
capable to get os events like the above pseudo-code, so on other OSs I just
lock inside the modal function and start calling the OS’s message dispatching
again:
Have you looked at the "Loop()" function (of BLooper, which BWindow
inherits from?) This runs the event loop in the current thread.
However you cannot really control it; that function will not return
until the event loop has been exited in some way (i.e. window closed,
usually.)
Alternatively you can simply subclass BWindow::MessageReceived and
forward all incoming events to a different event loop.
One way or another, the Qt port seems to handle the case of modal
windows without too many problems, as do other application ports, so
clearly those work. Perhaps you could see what they do.
-waddlesplash
Other related posts: