[haiku-development] Re: Can we do better with messages that are dispatched by the menu window looper?

  • From: John Scipione <jscipione@xxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Sat, 29 Feb 2020 16:50:25 -0500

On Sat, Feb 29, 2020, 3:41 PM Adrien Destugues <pulkomandy@xxxxxxxxxxxxx>
wrote:.


I'm pretty sure the menu knows which window/looper it is attached to,
and once you have that it's easy to send messages there.

However, I thought menus ran in their own threads and were essentially
separate windows (it's possible to put BViews into a menu with some
trickery), so, why do they need to hijack the parent window message loop
at all? It seems to me they could run fully independently?



You got it right, menus run in their window looper. How do you get the
attached/originating/parent window/looper from the menu window/looper to
send it a message?

BApplication => BWindow => MenuWindow

TTracker => TContainerWindow => MenuWindow

Grandparent => Parent => Child

The parent window in my case is ContainerWindow (aka a regular Tracker
window) and I'm not manipulating MessageLoop there but I am manipulating
the child MenuWindow looper to pass the message on to Grandpa's
be_app_messenger and then passing from TTracker to BContainerWindow because
that's all I have access to. How do we take grandpa out of the loop here?


Other related posts: