Add possible border handling in minimize all script
Summary: Adds screen edge handling in minimize all script. Test Plan: With a hacked KCM, setting the option works perfectly and updates correctly adding/removing the edge bindings as appropriate. Reviewers: #plasma, graesslin Reviewed By: #plasma, graesslin Subscribers: graesslin, kwin Tags: #kwin Differential Revision: https://phabricator.kde.org/D2263
This commit is contained in:
parent
4bb12f3f01
commit
530682f7b8
1 changed files with 19 additions and 0 deletions
|
@ -18,6 +18,8 @@ You should have received a copy of the GNU General Public License
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*********************************************************************/
|
*********************************************************************/
|
||||||
|
|
||||||
|
var registeredBorders = [];
|
||||||
|
|
||||||
function isRelevant(client) {
|
function isRelevant(client) {
|
||||||
return client.minimizable &&
|
return client.minimizable &&
|
||||||
(client.onAllDesktops || client.desktop === workspace.currentDesktop);
|
(client.onAllDesktops || client.desktop === workspace.currentDesktop);
|
||||||
|
@ -48,4 +50,21 @@ var minimizeAllWindows = function() {
|
||||||
clients = [];
|
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);
|
registerShortcut("MinimizeAll", "MinimizeAll", "Meta+Shift+D", minimizeAllWindows);
|
||||||
|
init();
|
||||||
|
|
Loading…
Reference in a new issue