[server] Make double-buffered properties in xdg-shell double-buffered
ClosedPublic

Authored by zzag on Sep 5 2019, 7:00 PM.

Details

Summary

So far all double-buffered properties in our implementation of xdg-shell
weren't actually double-buffered. When a property setter is invoked, we
pray to the God hoping that the client committed associated surface.

This change introduces private SurfaceRole class. The new class provides
a way for SurfaceInterface to commit pending state of associated shell
surface.

The chosen architecture allows us to do more in the future. For example,
we could use SurfaceRole to prevent associating several roles to a single
wl_surface object, e.g. xdg-toplevel to a pointer surface, etc.

Test Plan

This change breaks support for client-side decorated clients in KWin.

Diff Detail

Repository
R127 KWayland
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
zzag created this revision.Sep 5 2019, 7:00 PM
Restricted Application added a project: Frameworks. · View Herald TranscriptSep 5 2019, 7:00 PM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
zzag requested review of this revision.Sep 5 2019, 7:00 PM

pray to the God hoping that the client committed associated surface.

Practically its nowhere near as bad as this sounds. We might send a configure event early, but it'll only ever have an application after a new commit.
The most that will be broken is unbatched configure calls - still worth doing though.

Api makes sense.

Only question is whether it'd more useful to have an api which helps track that we only have one role, or have an api where /all/ the objects attached to a surface (blur, plasma shell, etc.) can easily double buffer.

src/server/xdgshell_stable_interface.cpp
232

size of 0 has a special meaning.

When a client initially sets the value to 0,0 we don't want to treat it as a change.

Unless you add this logic into the setMaximumSize callback ShellClient will have to handle the 0,0 anyway.

zzag added a comment.Sep 7 2019, 9:09 PM

Only question is whether it'd more useful to have an api which helps track that we only have one role, or have an api where /all/ the objects attached to a surface (blur, plasma shell, etc.) can easily double buffer.

Not sure about the latter, but we definitely need to track attached surface role.

zzag updated this revision to Diff 65603.Sep 7 2019, 9:10 PM

Handle value of zero in set_max_size callback.

This revision was not accepted when it landed; it landed in state Needs Review.Nov 27 2019, 12:40 PM
This revision was automatically updated to reflect the committed changes.