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

  • From: "X512" <dmarc-noreply@xxxxxxxxxxxxx> (Redacted sender "danger_mail" for DMARC)
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Tue, 3 Mar 2020 21:27:32 +0900

On 2020/03/03 21:18, John Scipione wrote:

A BMessageFilter cannot work because as the name implies a message filter allows you to filter out messages directed to your handler that you're not interested in, it has no ability to redirect messages to handlers on other Loopers. For that you need to use a BMessenger, or BLooper::PostMessage. Look at my patch set and and you'll see there is already a clean separation between MenuWindow which handles layout and message passing and the BMenu subclasses in Tracker where the business logic is implemented.
It is possible just use BView::SetEventMask(B_KEYBOARD_EVENTS) on some view when menu is opened and avoid message dispatching tricks.

Other related posts: