Re: _NET_WM_[GET_|TAKE_|REQUEST_]FOCUS & urgency



On 5/25/05, Luke Schierer <lschiere users sf net> wrote:
 
> Hopefully you all will find some of our points/ideas/statements
> useful, and will come up with something better than either the
> existing behavior or the new, arguably worse behavior (short of
> rewriting all existing legacy X applications that might create a
> window).

I don't see why you insist that a not-fully-baked implementation
(which is probably my fault) is indicative that the specification is
wrong.

Anyway, let me address some of your points.  (Note that gmail sucks
with manually spaced tables/lists, so this may not come out very well)

> * window focus should only be transfered from one window to another by the direct action of the user.

Basically correct, but too vague to be useful.  What if a user
launches an application, then interacts with another application while
waiting for the first application to appear?  You totally miss that
case.

>         * The WM does not know when a new window is user initiated or not.
>         * The application that requests the new window does know

Yes, and unfortunately getting that information to the WM is a royal
pain in the rear, as it involves so many libraries and special cases,
and even apps

>         * In the case of new application launch, this yields a useful result: you can start several things
>           in the background (or on login) and not have your focus jerked around as they start.

Yes.

>         * While it is acceptable to design a specification by which an application which does not currently
>           have focus can request it either by creation of a new window, or for an existing window, such
>           a specification should be an opt-in policy.  quoting Etan:
>                   "If, however, people feel that there should be a way for an application to request focus on
>                   mapping that's fine. Such a specification should be written such that it is an opt-in concept,
>                   not an opt-out one (or one that requires all applications to follow for it to work). For
>                   example, given our experience with metacity (and the focus stealing prevention spec) the fact
>                   that gaim does not do anything to accomodate the spec used to cause all of our windows to be
>                   on top and focused, and now causes all our windows to be popped up underneath other windows.
>                   This is really an unacceptable way to design a new specification, especially when dealing with
>                   something as old as X and which has legacy applications which one wants to continue to have act
>                   correctly. If the purpose of this spec is to only make windows that really want focus on map
>                   to get it than require that *those applications* set the property to some agreed upon value or
>                   set of values, and that anything which does not is going to be treated in a wm consistent and
>                   non-annoying fashion (i.e. not given focus on map, but also not hidden and therefore requiring
>                   further specification to function usefully)."

You want to have every application decide whether it gets focus when
it's mapped?!?!?  That would result in a totally inconsistent
experience, with half the apps choosing one way and the other half
choosing the other way, and both sides being wrong some of the time. 
Applications don't have a global awareness of what has occurred, so
how could it correctly make the decision about whether it gets focus
when it is mapped?  Applications should instruct the WM about whether
new windows were launched by user interaction and when, but the choice
should be up to the WM.  That's the only way to get consistent,
predictable, usable behavior.

Granted, steps do need to be taken to handle legacy apps as good as
possible.  But it's a crapshot left up to the window manager on how to
deal with them, since it's impossible to get things right for them in
all cases.

> * new windows should be created at the top level unless specifically requested otherwise by the starting
>   application.  Placement should reflect some overall policy of the WM, preferably a policy that the
>   user understands and can predict.  Remembering previous placement is a reasonable, but not required,
>   part of said policy.
>         * Window stacking and focus policy should be at least somewhat decoupled.
>         * It is acceptable for a window manager's overall focus policy to include some concept of absolute
>           Z-level and restrict an application to a single Z-level.  Such a policy, however, should include
>           some method to notify the user that a new window has been created.

I responded to this in the other email.

> * Applications which currently have focus should be able to hint if a window said application has
>   created gets focus or not.

Agreed; that's what the spec does.

>   It should be able to do so without changing the level at which the window
>   is created (assuming the hint is followed).

Disagreed; as stated in my other email, I don't think applications
should be able to obscure what I'm working on--that's not a valid way
of notifying me that there's a new window to interact with.

>         * While it may be valuable to specify or further specify how this should be done, _NET_WM_USER_TIME
>         in it's current overloaded state does not seem to us to be a viable solution for this. We would
>         suggest something like a _NET_WM_[GET_|TAKE_|REQUEST_]FOCUS property.

"The Gnome implementation isn't what we want; it obviously isn't
buggy, therefore the spec is bad and something else should replace it"

I'm responsible for a large part of the Gnome implementation.  It's
buggy, and it's mostly my fault.  But it ISN'T a reflection on the
spec.  ;-)

> * Applications which do not have focus should not be able to pull focus from another application in a
>   way that the user cannot disable or modify.  Changes to individual applications at a source code
>   level should not be necessary for this behavior.

Yes, and the spec mostly handles this.  Unfortunately, it is
impossible to achieve 100% because of an inherent design problem in X:
X allows applications to set the focus and doesn't consult the window
manager whether such an action should be allowed.  The WM can attempt
to detect and correct such an action, but cannot prevent it.

>   * _NET_WM_STATE_DEMANDS_ATTENTION may have merit here if used to indicate that a window which requests
>     focus was not given in so as to comply with the WM's policies on focus.
> * Window managers and and applications should  both support both the ICCCM and fd.o specs

No reason to disagree...

>         * That being said, ICCCM has been a specification since 1993, and (for example) gnome should be
>           supporting urgency before they get too upset about us not supporting
>           _NET_WM_STATE_DEMANDS_ATTENTION.  Further, we undertake to implement support for this after
>           Gnome supports urgency.

You shouldn't need to do anything to support DEMANDS_ATTENTION. 
Nothing.  You may need to do something to support _NET_WM_USER_TIME
(though I don't know of any off the top of my head).  Yes, we need to
support Urgency, but as I said elsewhere, Urgency support won't help
you with this problem at all.  What you need is for us to get decent
support for DEMANDS_ATTENTION.


Hope that helps,
Elijah



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]