<table><tr><td style="">zzag updated this revision to Diff 82070.<br />zzag edited the summary of this revision. <a href="https://phabricator.kde.org/transactions/detail/PHID-XACT-DREV-ptv46wzydyb4br4/">(Show Details)</a><br />zzag added a comment.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D27861">View Revision</a></tr></table><br /><div><div><p>Rebase on KWaylandServer changes.</p></div></div><br /><div><strong>CHANGES TO REVISION SUMMARY</strong><div><div style="white-space: pre-wrap; color: #74777D;"><span style="padding: 0 2px; color: #333333; background: rgba(251, 175, 175, .7);">First of all, sorry for the big patch.<br />
<br />
Currently, we implement Wayland protocol wrappers in KWayland and then<br />
add necessary "glue" code here in KWin. Because KWayland is a KF library,<br />
we are not able to change existing API in ways that may break API or<br />
ABI compatibility. So, if some particular wrapper has been implemented<br />
incorrectly, we can't do that much about it except maybe leaving<br />
comments that look like "// TODO KF6".<br />
<br />
Another problem with KWayland is that we try to build abstractions over<br />
something that is unstable. We do this in the name of the "don't repeat<br />
yourself" mantra. While it is a good approach to keep the amount of<br />
duplicated code as low as possible, we basically ask for trouble. If a<br />
new version of an unstable protocol comes along with dramatic changes,<br />
we are screwed.<br />
<br />
The current xdg-shell wrappers in KWayland were designed for xdg-shell<br />
v5, which didn't have objects such as xdg-toplevel or xdg-positioner.<br />
Unfortunately, we can't change existing classes because of the API and<br />
ABI compatibility promises we made.<br />
<br />
</span>This change splits the XdgShellClient class to better match existing<span style="padding: 0 2px; color: #333333; background: rgba(251, 175, 175, .7);"><br />
abstractions in the xdg-shell protocol. Unfortunately, since xdg-shell<br />
wrappers in KWayland weren't designed for xdg-shell v6+, I had to<br />
re-implement them here in KWin. The new wrappers weren't implemented in<br />
KWayland because I cannot guarantee that the future versions of the<br />
wrappers will be API compatible.<br />
<br />
The XdgSurface{V6}Client class is concerned mainly about things such as<br />
mapped/unmapped state and geometry, while XdgToplevel{V6}Client and</span><br />
<span style="padding: 0 2px; color: #333333; background: rgba(251, 175, 175, .7);">XdgPopup{V6}Client are concerned about role-specific things, for example</span><span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);">abstractions in the xdg-shell protocol and fix a few issues related to</span><br />
<span style="padding: 0 2px; color: #333333; background: rgba(251, 175, 175, .7);">the window state, etc</span><span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);">sending configure events</span>.<div style="padding: 8px 0;">...</div>Given that configure events are not sent immediately, XdgSurfaceClient<br />
<span style="padding: 0 2px; color: #333333; background: rgba(251, 175, 175, .7);">and XdgSurfaceV6Client </span>keep<span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);">s</span> the last requested frame geometry and the<span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);"> last requested client</span><br />
<span style="padding: 0 2px; color: #333333; background: rgba(251, 175, 175, .7);">last requested client </span>geometry.<br />
<br />
This <span style="padding: 0 2px; color: #333333; background: rgba(251, 175, 175, .7);">change</span><span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);">patch</span> doesn't intend to fix all <span style="padding: 0 2px; color: #333333; background: rgba(251, 175, 175, .7);">things that are currently broken<br />
in the xdg-shell wrappers and the XdgShellClient class. For example,<br />
we don't reset XdgSurfaceInterface when the wl_surface is unmapped, we</span><span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);">issues in kwin's implementation of</span><br />
<span style="padding: 0 2px; color: #333333; background: rgba(251, 175, 175, .7);">handl</span><span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);">th</span>e xdg-<span style="padding: 0 2px; color: #333333; background: rgba(251, 175, 175, .7);">popup grabs poorly, etc</span><span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);">shell protocol</span>. <span style="padding: 0 2px; color: #333333; background: rgba(251, 175, 175, .7);">Instead</span><span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);">For example</span>, <span style="padding: 0 2px; color: #333333; background: rgba(251, 175, 175, .7);">this change lays the</span><span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);">we still handle surface unmapping</span><br />
<span style="padding: 0 2px; color: #333333; background: rgba(251, 175, 175, .7);">foundation for the future improvements</span><span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);">very poorly</span>.</div></div></div><br /><div><strong>REPOSITORY</strong><div><div>R108 KWin</div></div></div><br /><div><strong>CHANGES SINCE LAST UPDATE</strong><div><a href="https://phabricator.kde.org/D27861?vs=77977&id=82070">https://phabricator.kde.org/D27861?vs=77977&id=82070</a></div></div><br /><div><strong>BRANCH</strong><div><div>split-xdg-shell-client-2</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D27861">https://phabricator.kde.org/D27861</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>CMakeLists.txt<br />
autotests/integration/maximize_test.cpp<br />
autotests/integration/move_resize_window_test.cpp<br />
autotests/integration/quick_tiling_test.cpp<br />
autotests/integration/xdgshellclient_rules_test.cpp<br />
autotests/integration/xdgshellclient_test.cpp<br />
deleted.cpp<br />
effects.cpp<br />
placement.cpp<br />
wayland_server.cpp<br />
wayland_server.h<br />
waylandclient.cpp<br />
waylandclient.h<br />
xdgshellclient.cpp<br />
xdgshellclient.h</div></div></div><br /><div><strong>To: </strong>zzag, KWin<br /><strong>Cc: </strong>anthonyfieroni, univerz, davidedmundson, kwin, Orage, cacarry, LeGast00n, The-Feren-OS-Dev, cblack, jraleigh, zachus, fbampaloukas, mkulinski, ragreen, jackyalcine, iodelay, crozbo, bwowk, ZrenBot, ngraham, alexeymin, himcesjf, lesliezhai, ali-mohamed, hardening, romangg, jensreuterberg, abetts, sebas, apol, ahiemstra, mart<br /></div>