diff --git a/scripts/minimizeall/contents/code/main.js b/scripts/minimizeall/contents/code/main.js index a8e17e8000..d87c187a47 100644 --- a/scripts/minimizeall/contents/code/main.js +++ b/scripts/minimizeall/contents/code/main.js @@ -18,6 +18,8 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . *********************************************************************/ +var registeredBorders = []; + function isRelevant(client) { return client.minimizable && (client.onAllDesktops || client.desktop === workspace.currentDesktop); @@ -48,4 +50,21 @@ var minimizeAllWindows = function() { clients = []; } +function init() { + for (var i in registeredBorders) { + unregisterScreenEdge(registeredBorders[i]); + } + + registeredBorders = []; + + var borders = readConfig("BorderActivate", "").toString().split(","); + for (var i in borders) { + registeredBorders.push(borders[i]); + registerScreenEdge(borders[i], minimizeAllWindows); + } +} + +options.configChanged.connect(init); + registerShortcut("MinimizeAll", "MinimizeAll", "Meta+Shift+D", minimizeAllWindows); +init();