xdg_surface initial configuration

Bill Spitzak spitzak at gmail.com
Tue Nov 3 12:24:02 PST 2015


On Mon, Nov 2, 2015 at 1:20 PM, Michael Forney <mforney at mforney.org> wrote:

> On Wed, Sep 23, 2015 at 12:10:02PM -0700, Bill Spitzak wrote:
> > Seems like the wl_display.sync() can do the job. The compositor may send
> > several configure events, that is harmless. Just use the last one.
> >
> > A compositor *may* try to predict where the window is going to be mapped.
> > This prediction may change due to methods such as set_app_id. It may also
> > change due to actions by other clients or the user which can happen at
> any
> > time (and thus there is no way for the client to put a call after them).
> > All of these would send configure events. It is ok that it may send a lot
> > of them. Just respond to the last one.
>
> I think that this does not completely solve the problem.
>
> For example, suppose I start client foo, and I have a special rule that
> puts foo windows on some other screen. Since the compositor does not yet
> know that the client is foo, it sends a configure event to re-tile the
> windows to make room for the client on the current screen. It then
> receives the set_app_id request and realizes the window should have been
> placed on the other screen, so it configures all the windows back to the
> way they were before.


> The foo client may not have any problems because it is in the middle of
> a wl_display_roundtrip, but the other clients may receive the first
> event, but not yet the second, causing them to redraw for a new size.
> Then they see the original size and redraw the original frame again.
> This would cause flicker on the primary screen, even though nothing
> changed about those windows.
>
> I suppose that if I delay retiling the other windows until I have
> received the initial buffer from the new client, this wouldn't be a
> problem, but it would essentially cause the new client resize and the
> existing client resize roundtrips to happen sequentially rather than in
> parallel. I'll have to do some testing to see if this actually causes
> any noticable delay/flicker when retiling due to a new client.
>

I think it is a requirement that it be possible to avoid any such mistake
entirely. It should be possible to always draw a 100% perfect screen image.
Only if the latency is unacceptable should it then resort to flicker.

I think this could be done in the way you say if the compositor then blocks
until it receives updated buffers from all the other clients that get
resized. This would match how you have to handle the user moving the border
between tiles: it has to block until it gets updated buffers from all
clients that have a new size.

However you are right that this defers sending the configure events to the
other clients until after the foo client has responded to it's configure
event, when it certainly seems like it could send the configure events to
all the clients simultaneously. I am not really certain this is going to be
a huge problem (the foo client is certainly swapped in and ready to draw
it's image) but it does seem like fixing it would require a commit request
of some type.

I'm thinking now that this is occurring often enough that it would be
cleaner to build such commits in at a low-level into wayland. Rather than
the commit message on wl_surface, and the new "axis finished" events being
sent the other way, there is a single request and event on wl_display, that
indicate a break between atomic blocks of changes (also quite a few
requests and events, such as the sync and ping/pong would imply breaks).
This would avoid adding these extra events/requests to all the api's, and
also free the clients and compositors from having to deal with
"intersecting" blocks where events that require commit-type-A are mixed in
with events requiring commit-type-B.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/wayland-devel/attachments/20151103/d114096e/attachment.html>


More information about the wayland-devel mailing list