<table><tr><td style="">graesslin created this revision.<br />graesslin added reviewers: KWin, Plasma.<br />Restricted Application added a project: KWin.<br />Restricted Application added subscribers: kwin, plasma-devel.
</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/D8345" rel="noreferrer">View Revision</a></tr></table><br /><div><strong>REVISION SUMMARY</strong><div><p>The test DontCrashUseractionsMenu (Waylandonly) found an issue in our<br />
screen handling implementation in the QPA. The code exposed a short time<br />
frame between the dummy screen getting destroyed and the first screen<br />
being added. This could result in a crash of KWin.</p>

<p>There is actually no need to implement Screen on top of Wayland screen.<br />
KWin has all the knowledge, so we can also base this on top of the<br />
Screens API.</p>

<p>Advantages:</p>

<ul class="remarkup-list">
<li class="remarkup-list-item">no delays due to Wayland roundtrips</li>
<li class="remarkup-list-item">handle screen getting removed (was a TODO)</li>
<li class="remarkup-list-item">handle resolution changes (was a TODO)</li>
</ul>

<p>The new implementation has a disadvantage that it destroys and readds<br />
all screens whenever something around the screen changes. This shouldn't<br />
be an issue in practice as it's only for the internal QPA and thus only<br />
affects KWin internal windows which is placed in global coordinates<br />
anyway. If it turns out to be a problem we need to track better the<br />
screen changes - so far those were not tracked at all.</p></div></div><br /><div><strong>TEST PLAN</strong><div><p>Run a few unit tests which change screens</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R108 KWin</div></div></div><br /><div><strong>BRANCH</strong><div><div>qpa-screens</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D8345" rel="noreferrer">https://phabricator.kde.org/D8345</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>autotests/integration/CMakeLists.txt<br />
plugins/qpa/integration.cpp<br />
plugins/qpa/integration.h<br />
plugins/qpa/screen.cpp<br />
plugins/qpa/screen.h</div></div></div><br /><div><strong>To: </strong>graesslin, KWin, Plasma<br /><strong>Cc: </strong>plasma-devel, kwin, bwowk, ZrenBot, progwolff, lesliezhai, ali-mohamed, hardening, jensreuterberg, abetts, sebas, apol, mart<br /></div>