Why isn't Xwayland just a Wayland client?

Pekka Paalanen ppaalanen at gmail.com
Wed Sep 6 14:45:01 UTC 2017

On Wed, 6 Sep 2017 15:59:17 +0200
Joseph Burt <caseorum at gmail.com> wrote:

> Hi Daniel,
> On Wed, Sep 6, 2017 at 1:09 PM, Daniel Stone <daniel at fooishbar.org> wrote:
> >
> > No-one wanted to write yet another X11 window manager; what's there is
> > there by necessity so as not to break existing clients. For instance,
> > pop-up menus rely heavily on the global co-ordinate system remaining
> > intact.  
> Are popup notifications impossible in Wayland clients? How is that
> solved for them?

Popups (e.g. menus) in Wayland use protocol that provides the server
- the relationship to the window which the popup is for, and
- the input event identity that triggered the popup.

These are required on Wayland: the parent window is required for
positioning and stacking, and the input event identity determines
whether the popup is valid.

X11 protocol does not necessarily provide these. On X11, the client
puts a window at x,y and makes an input grab. That's it.

You would have to infer from x,y and the X11 window stack which X11
window might be the parent (if it even exists) and guess what input
event might have triggered the popup (there might not be any) to be
able to translate that into Wayland.

Xwayland would also need to guess that the input grab is related to
showing the window to be able to combine the two actions into a popup
request on Wayland.

I hope this gives you an idea why it is so hard to try to translate
window management from X11 to Wayland protocol. Writing an X11 window
manager is extremely painful to begin with, making one that can
translate into Wayland is much more painful because of the fundamental
design differences. The "out-of-band" design of putting an X11 WM in a
Wayland compositor and using X11 to manage X11 windows is the
compromise to get things working.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/wayland-devel/attachments/20170906/9dbf2d9e/attachment.sig>

More information about the wayland-devel mailing list