On 11.03.2007 21:22, Peter Amstutz wrote:
> Bingo!  I just reviewed a couple of old checkouts of Crystal Space I 
> have, and it looks like some one "cleaned up" (i.e. broke) the plugin.
> 
> I orginally had a function:
> 
>  void csGLCanvas::OnEnterWindow( wxMouseEvent& WXUNUSED(event) )
>  {
>   SetFocus();
>  }
> 
> Which fixes precisely the keyboard focus problem by giving it "focus 
> on enter" behavior.
> 
> Someone changed it to:
> 
>  void csGLCanvas::OnEnterWindow( wxMouseEvent& WXUNUSED(event) )
>  {
>   csRef<iEventNameRegistry> enr = CS_QUERY_REGISTRY (g2d->object_reg, 
> iEventNameRegistry);
>   g2d->EventOutlet->Broadcast(csevFocusGained(enr));
> }
> 
> The problem is, this tells Crystal Space has focus, but doesn't change 
> the *system* focus, which was the whole purpose of calling SetFocus().  
> Someone misread the purpose of the method and... broke it.
> 
> So, try re-adding SetFocus() to the csGLCanvas::OnEnterWindow() method 
> (in CS/plugins/video/canvas/wxgl/GLWXDriver2D.cpp).

I would say neither is right. "Mouse enter" and "gain focus" are two
distinct events, and a mouse enter generally does not cause a focus
change. Example: focus has an edit field, you want to type something.
For some reason, the mouse gets moved over the WXGL view... would you
want the WXGL view to take the focus? Probably not.

-f.r.

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
vos-d mailing list
vos-d@interreality.org
http://www.interreality.org/cgi-bin/mailman/listinfo/vos-d

Reply via email to