Opened 17 years ago
Closed 16 years ago
#2075 closed bug (invalid)
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/pre-alpha1 |
Keywords: | Cc: | ||
Blocked By: | Blocking: | ||
Platform: | x86 |
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: hrev24912 Installed to real partition (not VM) with Core Duo T2500/2GB memory
Attachments (1)
Change History (8)
by , 17 years ago
Attachment: | DigestCode.cpp added |
---|
comment:1 by , 17 years ago
comment:2 by , 17 years ago
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.
comment:3 by , 17 years ago
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
comment:4 by , 17 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Thanks for the investigation! Fixed in hrev24997. _SanitizeMessage() is called first, before the message gets to any filter or handler. The "be:view_where" is actually added by BeOS, too.
comment:6 by , 16 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
This change has been reverted in hrev26491 - "where" always only contains window coordinates, also in BeOS.
comment:7 by , 16 years ago
Resolution: | → invalid |
---|---|
Status: | reopened → closed |
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