[server] Make double-buffered properties in xdg-shell double-buffered
Needs ReviewPublic

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

Details

Reviewers
None
Group Reviewers
KWin
Maniphest Tasks
T11480: Make xdg-shell properties double-buffered
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
Branch
surface-role
Lint
Lint ErrorsExcuse: cppcheck doesn't understand Q_DECLARE_FLAGS macro
SeverityLocationCodeMessage
Errorsrc/client/xdgshell.h:92CppcheckunknownMacro
Errorsrc/client/xdgshell.h:92CppcheckunknownMacro
Unit
No Unit Test Coverage
Build Status
Buildable 16231
Build 16249: arc lint + arc unit
zzag created this revision.Thu, Sep 5, 7:00 PM
Restricted Application added a project: Frameworks. · View Herald TranscriptThu, Sep 5, 7:00 PM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
zzag requested review of this revision.Thu, Sep 5, 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.Sat, Sep 7, 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.Sat, Sep 7, 9:10 PM

Handle value of zero in set_max_size callback.