[haiku-development] Re: B_WILL_ACCEPT_FIRST_CLICK

  • From: "Axel Dörfler" <axeld@xxxxxxxxxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Thu, 23 Apr 2009 23:29:07 +0200 CEST

Brecht Machiels <brecht@xxxxxxxxxxx> wrote:
> Personally, I feel it is up to the user to decide whether a window 
> should accept the first click or not. It should also be a global 
> setting, and not something the application should choose. There might 
> be 
> exceptions to this rule, such as the Deskbar. However, I think 
> B_AVOID_FOCUS is more appropriate in this case.
> 
> I know there is not much enthusiasm about changing the BeOS behavior 
> or 
> adjusting the API, but I feel this might be something that could be 
> improved upon a lot.
> 
> I see two solutions:
> 1) we introduce a wrapper for Desktop::ActivateWindow(). As far as 
> I've 
> experienced, this works pretty well. However, it's a bit of a hack 
> and 
> might cause some unexpected behavior.
> 2) we deprecate the use of B_WILL_ACCEPT_FIRST_CLICK and introduce 
> the 
> possibility to prevent windows popping to front in the normal mouse 
> mode 
> on drags in general.

AFAICT the status quo is only really annoying if you wanted to 
implement something like the "click to focus" method you're working on. 
But I guess you're right that it's far from perfect, too.

I think that 2) would have the problem that an application would then 
still need to decide on its on when to put the window to front, which 
is not really a big deviation from what it does now, only the logic 
would be reverted.

I know, this is not really helpful. From an application developer's 
POV, I think giving a window focus, and bring it to front should be two 
different actions. Maybe we could have a window action class/method/
whatever that you can just tell your intentions, and it will then do 
whatever fits the current mouse mode best to achieve this. Like with 
HTML where you can, say, ask specifically for a bold font (ie. 
Activate()), or just use <strong> when this is all you want to achieve.

Bye,
   Axel.


Other related posts: