[RFC wayland-protocols] unstable: add protocol to give focus to a foreign surface

Drew DeVault sir at cmpwn.com
Thu Jul 5 15:56:35 UTC 2018


I'm not sure why an activiation request has to jump through these
surface export hoops first. We export a surface... to do what with it?
Export it to whom? What do they do with it? Instead, we could just
activate the surface (though I'd suggest activating an xdg_toplevel
rather than an arbitrary surface) directly. In that case I think it
would be wise to just put an "activate" request (or perhaps "urgent" to
avoid overloading the term) on xdg_toplevel rather than adding a
standalone protocol.

Also, there are use-cases where applications can raise an urgency hint
without stealing focus (though on X they very well might do that today),
such as a chat client receiving a private message. Expressing this to
the compositor via xdg_toplevel would be a good way to e.g. display that
application differently in the panel.

I see where you're going with this, though: an atomic and secure way of
transferring focus to another application. This looks like an attempt to
express something like intents on Wayland. I suggest looking into
existing intents systems (e.g. Android) for prior art and putting
together something a bit more sophisticated (and it might not make sense
for it to live entirely in Wayland).

Perhaps designing an out-of-band intents system first, then having it
express some kind of handle, which can then be referred to from Wayland
for the purpose of securely transferring focus, would be a better
approach. It's hard to design a good Wayland protocol against the
ephemeral "it may exist eventually" out-of-band negotiation process.

--
Drew DeVault


More information about the wayland-devel mailing list