Re: [AD] Some thoughts about multi-window applications

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On 2009-08-12, Evert Glebbeek <eglebbk@xxxxxxxxxx> wrote:
> On 12 Aug 2009, at 10:15 , Elias Pschernig wrote:
> >> 2. Related question: I'm working under the assumption that the last
> >> created window has input focus. Is this true on all platforms (it
> >> would make sense)?
> >
> > Definitely not - for example compiz has 5 different "focus stealing
> > prevention" options and most of them will not allow new windows to get
> > focus (or be raised above the window which currently has focus).
> 
> Well, that's bad.
> Let me clarify though: if the application that has input focus opens a  
> new window, it would make sense to me if that new window received  
> input focus. The rationale being that the window is opened in response  
> to a user action and the user needs to interact with the window next.
> Conversely, a background process should never raise a new window that  
> gets input focus. That's not how it works?

It depends on the window manager.  For example, if I'm typing an email and
I launch a web browser which takes a little while to start, I don't want the
browser steal the input focus or raise its window to the top, because
I'm still doing something else.

> Alternatively, could we add functions to query which (Allegro) window  
> currently receives keyboard input (this might be NULL if no Allegro  
> window has input focus) and to tell an Allegro window to try to get  
> keyboard input? Eg,
> ALLEGRO_DISPLAY *al_get_key_window(void);
> void al_make_key_window(ALLEGRO_DISPLAY *dpy);

I was going to suggest:

    void al_request_display_focus(ALLEGRO_DISPLAY *dpy);

so something along those lines, yes.  The window manager is free to ignore
the request.

Peter




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/