Debian Codegraph @

src/plugins/videowall/package/contents/code/main.js

raw symbols SCIP
1 /*
2 KWin - the KDE window manager
3 This file is part of the KDE project.
4
5 SPDX-FileCopyrightText: 2012 Martin Gräßlin <[email protected]g>
6
7 SPDX-License-Identifier: GPL-2.0-or-later
8 */
9
10 var applyTo = readConfig("ApplyTo", true);
11 var whitelist = readConfig("Whitelist", "vlc, xv, vdpau, smplayer, dragon, xine, ffplay, mplayer").toString().toLowerCase().split(",");
12 for (i = 0; i < whitelist.length; ++i)
13 whitelist[i] = whitelist[i].trim();
14
15 var ignore = readConfig("Ignore", false);
16 var blacklist = readConfig("Blacklist", "").toString().toLowerCase().split(",");
17 for (i = 0; i < blacklist.length; ++i)
18 blacklist[i] = blacklist[i].trim();
19
20
21 function isVideoPlayer(client) {
22 if (applyTo == true && whitelist.indexOf(client.resourceClass.toString()) < 0)
23 return false; // required whitelist match failed
24 if (ignore == true && blacklist.indexOf(client.resourceClass.toString()) > -1)
25 return false; // required blacklist match hit
26 return true;
27 }
28
29 function setup(window) {
30 window.fullScreenChanged.connect(() => {
31 if (window.fullScreen && isVideoPlayer(window)) {
32 window.frameGeometry = workspace.clientArea(KWin.FullArea, window);
33 }
34 });
35 }
36
37 workspace.windowAdded.connect(setup);
38 workspace.windowList().forEach(setup);