@@ -244,34 +244,55 @@ PlasmaCore.Dialog {
244244 let index = localWindows .indexOf (window );
245245 if (index != - 1 ) {
246246 localWindows .splice (index, 1 );
247- }
248247
249- if (! window .desktops .includes (currentDesktop)) {
250- window .desktops = [currentDesktop];
251- }
252- if (! window .activities .includes (currentActivity)) {
253- window .activities = [currentActivity];
254- }
255- if (window .mt_auto ) {
256- autoTiler .disableAutoTiling (window );
257- }
258- if (window .minimized ) {
259- window .minimized = false ;
248+ if (! window .desktops .includes (currentDesktop)) {
249+ window .desktops = [currentDesktop];
250+ }
251+ if (! window .activities .includes (currentActivity)) {
252+ window .activities = [currentActivity];
253+ }
254+ if (window .mt_auto ) {
255+ autoTiler .disableAutoTiling (window );
256+ }
257+ if (window .minimized ) {
258+ window .minimized = false ;
259+ }
260+ root .moveAndResizeWindow (window , geometry);
261+ Workspace .raiseWindow (window );
262+
263+ activeIndex = 0 ;
264+
265+ if (localWindows .length == 0 || convertedOverlay .length == 0 ) {
266+ windowSuggestions .visible = false ;
267+ validWindows = [];
268+ } else {
269+ validWindows = localWindows;
270+ if (suggestionsInsideTile) {
271+ updateSizes ();
272+ }
273+ updateOffsets ();
274+ }
260275 }
261- root . moveAndResizeWindow ( window , geometry);
262- Workspace . raiseWindow ( window );
276+ }
277+ }
263278
264- activeIndex = 0 ;
279+ function windowClosed (window ) {
280+ log (' Closed window caption: ' + window .caption );
265281
266- if (localWindows .length == 0 || convertedOverlay .length == 0 ) {
267- windowSuggestions .visible = false ;
268- validWindows = [];
269- } else {
270- validWindows = localWindows;
271- if (suggestionsInsideTile) {
272- updateSizes ();
282+ if (activeIndex != - 1 && validWindows .length > 0 ) {
283+ let localWindows = [... validWindows];
284+ let index = localWindows .indexOf (window );
285+ if (index != - 1 ) {
286+ localWindows .splice (index, 1 );
287+
288+ if (localWindows .length == 0 ) {
289+ validWindows = [];
290+ } else {
291+ validWindows = localWindows;
292+ if (suggestionsInsideTile) {
293+ updateSizes ();
294+ }
273295 }
274- updateOffsets ();
275296 }
276297 }
277298 }
0 commit comments