[interfacekit] Re: App Activation
- From: Ingo Weinhold <bonefish@xxxxxxxxxxxxxxx>
- To: Philippe Houdoin <philippe.houdoin@xxxxxxx>
- Date: Wed, 31 Jul 2002 16:35:37 +0200 (MET DST)
On Wed, 31 Jul 2002, Philippe Houdoin wrote:
> First, sorry for replying you privatly, but my OBOS interfacekit subscription
> is still pending...
No problem.
> > The weird thing is that (with libbe) my test application class'
> > AppActivated() isn't invoked. I create a standard window
> >
> > BWindow *window = new BWindow(BRect(100, 100, 200, 200),
> > "roster-test", B_TITLED_WINDOW, B_QUIT_ON_WINDOW_CLOSE);
> > window->Show();
> >
> > and the B_APP_ACTIVATED messages appear in MessageReceived(), but
> > AppActivated() isn't called.
> > [...]
> > Do I miss anything, or is the R5 implementation buggy? If it is, do we
> > mimic that behavior or e.g. call the hook method from
> > BApplication::MessageReceived()?
>
> The R5 implementation's buggy, like it was in R4.5 and R4!
> Give a look at this BeCodeTalk thread:
> http://www.escribe.com/software/becodetalk/m2512.html
>
> Seem someone at Be Inc. confuse B_SOME_APP_ACTIVATED with B_APP_ACTIVATED,
> and never find the time to fix it. :-)
Now that you mention it, IIRC (I don't have BeOS at hand right now) I
didn't get B_APP_ACTIVATED, but B_SOME_APP_ACTIVATED messages. I
encountered the message constant ('BRAW') in Roster.h and saw that it was
B_SOME_APP_ACTIVATED, but assumed, B_APP_ACTIVATED was simply defined the
same.
So it pretty much looks like someone at Be fixed the bug in both places,
i.e. now B_SOME_APP_ACTIVED is sent, but also
BApplication::DispatchMessage() has been changed to recognize
B_APP_ACTIVATED.
> I guess as the ones in the know who have implement the Tyler *hack* and
> every others don't care, you could fix this in OBOS implementation...
Tyler Riti's change isn't completely harmless. After fixing the bug in the
library, AppActivated() will be called twice for each message. As the
proposed work-around is completely transparent for the system, no fix can
avoid that. Also my idea, to call AppReceived() from
BApplication::MessageReceived() rather than from DispatchMessage() will
have the same problem -- though it doesn't harm those applications that
just catch the message in their MessageReceived() version, as it will
behave for them exactly like R5 does.
I think the best solution was to implement it as it should be, and see if
"real" applications are getting problems. If not, everything is fine, if
so, we will see what would be the best fix.
CU, Ingo
Other related posts: