[RFC : xdg_surface_present() - take 2

Manuel Bachmann manuel.bachmann at open.eurogiciel.org
Tue Mar 3 16:25:21 PST 2015


Hi Bill, and thanks a lot for your comments,

"What about "raise"?"

I think the issue with "raise" was the same that with "set_unminimized" or
"activate" ; it gives the false impression that the surface will
consistently be brought to the foreground (whereas it depends on many
things, and will in fact be rare).

"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."

You have a good point here. Ideally we would catch the very moment the user
clicks on the application icon, or starts it in a command line ; Jasper
pointed out a X11-specific variable named "DESKTOP_STARTUP_ID" (1) which
seems to do this very thing.

This kind of variable could be filled by the launcher, caught by the shell,
and then seamlessly passed to the client  (I personally wanted to avoid
over-engineering things in preliminary patches).

"'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."

Yes this is also a good point ; good you're mentioning that in that simple
way !

"Rather than per-surface I think it would be per-seat."

The current patch implementation makes it per-client, but in the end you're
right. We would only need to remember a few of the latest serials issued by
each input interface(keyboard/pointer/touch).

(1) :
http://lists.freedesktop.org/archives/wayland-devel/2014-August/016279.html

2015-03-03 22:15 GMT+01:00 Bill Spitzak <spitzak at gmail.com>:

>
>  - 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).
>



-- 
Regards,



*Manuel BACHMANN Tizen Project VANNES-FR*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/wayland-devel/attachments/20150304/10043a68/attachment.html>


More information about the wayland-devel mailing list