Ticket #2075 (closed bug: invalid)

Opened 9 months ago

Last modified 6 months ago

BMessageFilter handles BView's B_MOUSE_DOWN in BWindow coordinate

Reported by: shinta Owned by: axeld
Priority: normal Milestone: R1
Component: Kits/Interface Kit Version: R1 development
Cc: Blocked By:
Platform: x86 Blocking:

Description

I added a common filter to BWindow to handle B_MOUSE_DOWN.

When the filter handles B_MOUSE_DOWN message (the message is to be sent to BView), the message contains "where" property in BWindow coordinate. In BeOS R5, the message contains "where" property in BView coordinate.

Current my Haiku environment is: r24912 Installed to real partition (not VM) with Core Duo T2500/2GB memory

SHINTA

Attachments

DigestCode.cpp (1.4 KB) - added by shinta 9 months ago.

Change History

Changed 9 months ago by shinta

Changed 9 months ago by shinta

I found "be:view_where" property in B_MOUSE_DOWN message. "where" and "be:view_where" are convenient for getting BWindow/BView coordinate.

But, why don't you use "be:window_where" (BWindow coordinate) and "where" (BView coordinate) properties for backward (R5) compatibility?

SHINTA

Changed 9 months ago by stippi

We actually try to do this and be backwards compatible, but it appears not to be working for your particular case. If you want, you could have a look at src/kits/interface/Window.cpp. There is a function called _SanitizeMessage() which is supposed to make the messages backward compatible. But apparently, this function is not used before the messages are passed to BMessageFilters. I would need to look closer at the code, right now I don't have an idea how to fix this problem.

Changed 9 months ago by shinta

Although _SanitizeMessage() is not used before BMessageFilters, _SanitizeMessage() seem to be used after BMessageFilters. I could get "be:view_whare" in DigestCode.cpp's TTestHaikuWindow::MouseDown().

I simply think that how about modifying _SanitizeMessage() as follows:

// add local window coordinates message->AddPoint("be:window_where", ConvertFromScreen(where));

// add local view coordinates message->AddPoint("where", view->ConvertFromScreen(where)); message->AddPoint("be:view_where", view->ConvertFromScreen(where)); // for old Haiku

Changed 9 months ago by axeld

  • status changed from new to closed
  • resolution set to fixed

Thanks for the investigation! Fixed in r24997. _SanitizeMessage() is called first, before the message gets to any filter or handler. The "be:view_where" is actually added by BeOS, too.

Changed 9 months ago by shinta

Thank you!

SHINTA

Changed 6 months ago by axeld

  • status changed from closed to reopened
  • resolution fixed deleted

This change has been reverted in r26491 - "where" always only contains window coordinates, also in BeOS.

Changed 6 months ago by axeld

  • status changed from reopened to closed
  • resolution set to invalid
Note: See TracTickets for help on using tickets.