On 23/03/11 11:33, Manolo Gouy wrote:
>> When I create a new window, it gets an FL_SHOW, as expected.  When I
>> click in the new window, a mouse down and mouse up are sent to the new
>> window, and then after the mouse up, FL_FOCUS is sent to the *old*
>> window.  Every click on the new window yields a focus on the old
>> window (which according to the OS, doesn't have focus at all).  If I
>> type a key, the event goes to the new window as expected, and the
>> spurious FL_FOCUS stops happening and clicks are normal.
>>
>> I can reproduce this easily.  It might be specific to my app, but at
>> the moment I'm thinking it's not.  I'm investigating further, but does
>> this sound familiar to anyone else?
>>
>> OS X 10.6.6, current svn version of fltk.
>
> I'm trying to reproduce that with the editor demo and its
> File/New View menu item and OS X 10.6.
>
> I see that just after the new window is created, the old one has
> kept focus, but a click on any part of the new window, or even going
> to another application and then back to editor, is enough to bring
> focus to the new window. So, I'm not able to reproduce what you see
> where a click on one window sends FL_FOCUS to another one.
> This focus-gaining results from windowDidBecomeKey being notified
> by the system to the program which reacts by calling
>    Fl::handle( FL_FOCUS, w);
> So I don't understand why your program doesn't behave the same
> as the editor demo.
>
> I also see that adding
>    Fl::handle( FL_FOCUS, w);
> at the end of Fl_X::make() makes that the new window gets focus
> immediately after it appears on screen.
>
> P.S. the New View menu shortcut does not work, but that's another
> story. The option modifier can't be used for menu shortcuts
> on Mac OS because the option modifier changes the received character
> in a locale-dependent way.
>

Manolo - I've posted a new STR with two very small examples showing the 
focus issues I have in my own code (gmsh).

Christophe
_______________________________________________
fltk-dev mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-dev

Reply via email to