<table><tr><td style="">ksmanis created this revision.<br />ksmanis added reviewers: KWin, VDG.<br />Herald added a project: KWin.<br />Herald added a subscriber: kwin.<br />ksmanis requested review of this revision.
</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/D28781">View Revision</a></tr></table><br /><div><strong>REVISION SUMMARY</strong><div><p>Currently, the clicked window is unconditionally elevated and activated in the Desktop Grid effect. This patch adds a configuration toggle that controls this behavior, allowing the user to select a virtual desktop without worrying about disrupting the previously active window.</p>
<p>When the toggle is on (default), no change in the current behavior is observed, except that windows are not immediately elevated when clicked, but rather after maintaining the click for <tt style="background: #ebebeb; font-size: 13px;">QApplication::startDragTime()</tt> [1]. This change was introduced for the sake of consistency, since a timeout is required for the scenario that the toggle is off, in order to avoid window flickering caused by unnecessarily elevating a non-activated window. In other words, with the previous behavior, the clicked window would be immediately elevated, since it would end up being activated anyway. With this patch, the clicked window might not end up being activated, so we postpone elevating it until we are sure that it will also be activated.</p>
<p>When the toggle is off, the clicked window is not activated. Therefore, the user returns to an unchanged virtual desktop irrespectively of where he/she clicked in it.</p>
<p>[1] Dragging windows always results in them being activated.</p></div></div><br /><div><strong>TEST PLAN</strong><div><p>Screencast of current behavior (starts with default configuration for Desktop Grid effect):<br />
<a href="https://phabricator.kde.org/F8232947" style="background-color: #e7e7e7;
border-color: #e7e7e7;
border-radius: 3px;
padding: 0 4px;
font-weight: bold;
color: black;text-decoration: none;">F8232947: desktopgrid-2020-04-12_15.54.59_before.mp4</a></p>
<p>Screencast of patched behavior (starts with default configuration for Desktop Grid effect, i.e., the toggle is turned on, i.e., backwards compatible behavior):<br />
<a href="https://phabricator.kde.org/F8232955" style="background-color: #e7e7e7;
border-color: #e7e7e7;
border-radius: 3px;
padding: 0 4px;
font-weight: bold;
color: black;text-decoration: none;">F8232955: desktopgrid-2020-04-12_16.16.16_after.mp4</a></p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R108 KWin</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D28781">https://phabricator.kde.org/D28781</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>effects/desktopgrid/desktopgrid.cpp<br />
effects/desktopgrid/desktopgrid.h<br />
effects/desktopgrid/desktopgrid.kcfg<br />
effects/desktopgrid/desktopgrid_config.ui</div></div></div><br /><div><strong>To: </strong>ksmanis, KWin, VDG<br /><strong>Cc: </strong>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>