Skip to content

Commit

Permalink
Fixed memory leak and slow showDesktop
Browse files Browse the repository at this point in the history
  • Loading branch information
clefebvre committed Dec 23, 2011
1 parent 87a60e6 commit dbf3d97
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
4 changes: 2 additions & 2 deletions js/ui/showDesktopButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ ShowDesktopButton.prototype = {
windows[i].unminimize();
}
}
}
this._alreadyMinimizedWindows.length = []; //Apparently this is better than this._alreadyMinimizedWindows = [];
}
this._alreadyMinimizedWindows.length = []; //Apparently this is better than this._alreadyMinimizedWindows = [];
}
else {
for ( let i = 0; i < windows.length; ++i ) {
Expand Down
12 changes: 11 additions & 1 deletion js/ui/windowlist.js
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,17 @@ WindowList.prototype = {
},

_onMap: function(cinnamonwm, actor) {
this._refreshItems();
/* Note by Clem: The call to this._refreshItems() below doesn't look necessary.
* When a window is mapped in a quick succession of times (for instance if
* the user repeatedly minimize/unminimize the window by clicking on the window list,
* or more often when the showDesktop button maps a lot of minimized windows in a quick succession..
* when this happens, many calls to refreshItems are made and this creates a memory leak.
* It also slows down all the mapping and so it takes time for all windows to get unminimized after showDesktop is clicked.
*
* For now this was removed. If it needs to be put back, this isn't the place.
* If showDesktop needs it, then it should only call it once, not once per window.
*/
//this._refreshItems();
this._onWindowStateChange('map', actor);
},

Expand Down

0 comments on commit dbf3d97

Please sign in to comment.