[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: Tue, 3 Mar 2020 07:18:53 -0500

On Tue, Mar 3, 2020, 4:52 AM X512 <dmarc-noreply@xxxxxxxxxxxxx> wrote:

On 2020/03/03 18:37, Dario Casalinuovo wrote:
It's a BHandler but this handler is attached to the window where the
menu view is draw.

The looper/window we are discussing about is an internal window used
to draw the menu that is stealing the messages due to being focus.
BMenu is a BView that is attached to internal window when displayed
except for BMenuBar. It should be possible to receive messages targeted
to internal window by BMenu message filter. It is not required to attach
message filter to internal window directly.


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.


Other related posts: