[RFC : xdg_surface_present() - take 2

Bill Spitzak spitzak at gmail.com
Tue Mar 3 13:15:19 PST 2015


> - Pekka Paalanen pointed out the request name was unclear and suggested
> to use "xdg_surface_needs/wants_attention()" instead. Jasper St. Pierre
> pointed out that "_NET_WM_STATE_DEMANDS_ATTENTION" already existed in
> X11 and does not do the same thing. We discussed that again yesterday
> and thought that present() fitted nicely ;

What about "raise"?

> - Implementing focus stealing prevention between different clients may
> be easy : just count the delay between the client has been started and
> its shell surface actually gets mapped, and if it has been too long and
> the focus is elsewhere, show the surface without focusing it (but with a
> notification). The notion of "the client has been started" is vague, but
> at worst, we can use the time when the client did its initial connection
> to the compositor ;

I suspect that initial connection is going to be far too late. It will 
be after all the dynamic linking and static object initialization and 
script interpretation (imagine if the wayland api is written in the 
interpreted language, it will not open the display until quite a lot of 
interpretation is done), all of which are the real reason modern apps 
take forever to start up.

I would put the serial somewhere that the app can get it, perhaps in an 
environment variable, so it can send it with it's first raise request.

> - Within a same client application, however, it is harder.

Actually it is impossible without a serial. The serial is the correct 
solution which makes within the same client easier that between clients.

> This raises the question : how do we say "We have no serial to pass",
> for the standard case ? We repeatedly suggested 0 ("xdg_surface_present
> (surface, 0)") because serials are incrementing globals, so "0" to be
> issued would be very-very unlikely. Should we formalize that somewhere
> in the protocol ?

'0' is useful but should force the "the serial is too old" behavior. 
Anybody who wants a real raise will have to get an actual serial.

> We also want to secure the request from garbage random serials ; the
> implementation behavior is that there is only one serial valid for a few
> seconds, if the surface has not been focused for some time, it will not
> be able to raise itself even if it random()ly finds the formerly "good"
> serial.

It seems to me the compositor will have to remember very few serials. 
Rather than per-surface I think it would be per-seat. And there would be 
no timeout, instead it would remember the last N button or key presses 
(N quite possibley is 1).


More information about the wayland-devel mailing list