_NET_WM_USER_TIME and initial window(s)...



Hi all,

The CVS version of the EWMH spec states that clients should set the
_NET_WM_USER_TIME property on every new toplevel window before mapping
it.  However, it also states that clients shouldn't set this property
before receiving first input event.  I believe the latter restriction
is both unnecessary and harmful.

The restriction was there, I believe, merely because when
_NET_WM_USER_TIME was first introduced the app had no way to set it
due to the fact that we used to use the TIMESTAMP property instead of
having the timestamp be stored in the DESKTOP_STARTUP_ID environment
variable.  However, this restriction causes problems in the following
case:
  1) Launch Evolution
  2) Click in some other window
  3) The main Evolution window comes up
  4) Evolution immediately pops up a dialog window asking for your password
When the Evolution window comes up, the WM can use the _NET_STARTUP_ID
property (or the TIMESTAMP property if dealing with older startup
notification launchers) to find the timestamp it was launched with. 
Thus, the main Evolution window is correctly placed behind the current
window with the DEMANDS_ATTENTION hint set.  However, for the dialog
that pops up immediately afterward, there is no timestamp to compare
so the window manager gives it focus--against the user's wishes.

There is also a special case where we want to launch a special app (an
out-of-process dialog that is meant exclusively for use by the window
manager) and want to do so without full startup notification but still
follow the rules for focus-stealing-prevention.  To do so, we need to
either manually set _NET_WM_USER_TIME on the window (before mapping
it), or else allow gtk+ to do so with the information from the
DESKTOP_STARTUP_ID environment variable.  See the second half of
http://bugzilla.gnome.org/show_bug.cgi?id=152030 (though the first
half of that bug isn't relevant anymore...)

So, I would like to request that we remove the restriction on setting
_NET_WM_USER_TIME only after the first user interaction.  Would this
be okay?  I made a patch to do this (which I have attached), but I
also made some other cleanups/clarifications.  Please check it to make
sure I didn't accidentally introduce any problems.

Thanks,
Elijah



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