11function selectClient ( client ) {
22 client . setMaximize ( false , false ) ;
3+ client . shade = false ;
34 client . frameGeometry = Qt . rect (
45 mainWindow . x - ( assistPadding / 2 ) ,
56 mainWindow . y - ( assistPadding / 2 ) ,
@@ -38,10 +39,14 @@ function addListenersToClient(client) {
3839 client . windowClosed . connect ( function ( window ) {
3940 handleWindowClose ( client ) ;
4041 } ) ;
42+
43+ client . desktopChanged . connect ( function ( ) {
44+ if ( trackSnappedWindows && ! client . resize ) removeWindowFromTrack ( client . windowId ) ;
45+ } ) ;
4146}
4247
4348function onWindowResize ( window ) {
44- if ( activated ) AssistManager . hideAssist ( ) ;
49+ if ( activated ) return ;
4550 AssistManager . finishSnap ( false ) ; /// make sure we cleared all variables
4651
4752 const maxArea = workspace . clientArea ( KWin . MaximizeArea , window ) ;
@@ -159,7 +164,7 @@ function handleWindowFocus(window) {
159164
160165 for ( let i = 0 , l = windows . length ; i < l ; i ++ ) {
161166 if ( windows [ i ] !== window . windowId ) {
162- const w = workspace . getClient ( windows [ i ] ) ;
167+ const w = getClientFromId ( windows [ i ] ) ;
163168 if ( w && ! w . minimized ) workspace . activeClient = w ;
164169 }
165170 }
@@ -192,7 +197,7 @@ function applyActionToAssosiatedSnapGroup(client, callback){
192197 const i = snappedWindowGroups . findIndex ( ( group ) => group . windows . includes ( client . windowId ) ) ;
193198 if ( i > - 1 ) {
194199 const windows = snappedWindowGroups [ i ] . windows ;
195- windows . forEach ( windowId => callback ( workspace . getClient ( windowId ) ) ) ;
200+ windows . forEach ( windowId => callback ( getClientFromId ( windowId ) ) ) ;
196201 }
197202}
198203
@@ -218,7 +223,7 @@ function fillClosedWindow(closedWindow, group){
218223 const closedWindowGeom = closedWindow . frameGeometry ;
219224 const remainingWindows = group . windows ;
220225 for ( let i = 0 , l = remainingWindows . length ; i < l ; i ++ ) {
221- const window = workspace . getClient ( remainingWindows [ i ] ) ;
226+ const window = getClientFromId ( remainingWindows [ i ] ) ;
222227 if ( ! window ) continue ;
223228 if ( window . windowId == closedWindow . windowId ) continue ;
224229 const windowGeom = window . frameGeometry ;
@@ -244,13 +249,21 @@ function isEqual(a, b) {
244249 return a - b <= snapDetectPrecision && a - b >= - snapDetectPrecision ;
245250}
246251
252+ function getClientFromId ( windowId ) {
253+ return workspace . getClient ( windowId ) ;
254+
255+ /// Need to figure out reliable way for Wayland
256+ /// return Object.values(workspace.clients).find((el, index, arr) => el.windowId == windowId);
257+ }
258+
247259function shouldShowWindow ( client ) {
248260 if ( filteredClients . includes ( client ) ) return false ;
249261 if ( client . active || client . specialWindow ) return false ;
250262 if ( ! showMinimizedWindows && client . minimized ) return false ;
251263 if ( ! showOtherScreensWindows && client . screen !== workspace . activeScreen ) return false ;
252264 if ( ! showOtherDesktopsWindows && client . desktop !== workspace . currentDesktop ) return false ;
253265 if ( ! showSnappedWindows && snappedWindowGroups . findIndex ( group => group . windows . includes ( client . windowId ) ) > - 1 ) return false ;
266+ if ( client . activities . length > 0 && ! client . activities . includes ( workspace . currentActivity ) ) return false ;
254267 return true ;
255268}
256269
0 commit comments