xdg_surface initial configuration

Michael Forney mforney at mforney.org
Wed Sep 23 00:19:16 PDT 2015


I know this has been discussed before, but I recently came across a
situation that I think xdg_surface currently does not account for.

As far as I know, the expected interaction between client and compositor
is the client calls get_xdg_surface, then does a roundtrip to pick up
any configure event from the compositor. This way, it can draw its
first frame in the correct size and style.

Tiling compositors often want to be able to treat certain clients
specially by placing them on a certain monitor, or putting them in the
floating layer rather than tiling them. However, in order to classify
windows, they must have already set their title and app_id.

A compositor may not know the initial configuration until both title and
app_id are set, and it does not know whether or not the client intends
to set those properties until it receive the first buffer. A client
does not know the initial configuration to draw its first frame in until
it receives the configure event (or has not received a configure after a

I can think of a couple ways to solve this, but the simplest is probably
adding a new request, maybe called something like "ready", and the
client could send this request after it has finished setting any
necessary properties (title and app_id).

Here is how an interaction might look:

-> xdg_shell.get_xdg_surface(wl_surface)
-> xdg_surface.set_title("Foo")
-> xdg_surface.set_app_id("org.foo.Foo")
-> xdg_surface.set_maximized()
-> xdg_surface.ready()
-> wl_display.sync()
... client waits ...
<- xdg_surface.configure(800, 600, [maximized, activated], 1)
<- wl_callback.done()
-> xdg_surface.ack_configure(1)
-> wl_surface.attach(wl_buffer)
-> wl_surface.frame()
-> wl_surface.commit()
... client waits ...
<- wl_callback.done()

Compositors that do not care about handling clients specially by their
title and app_id can simply ignore the "ready" request, and clients
which do not send a "ready" request can be dealt with by just assuming
they have already set their properties when the first buffer is
attached (they may have to draw an extra frame though, as they do in the
current situation). So I think adding such a request should still behave
well with existing clients and compositors.

What do others think?

Michael Forney <mforney at mforney.org>

More information about the wayland-devel mailing list