File indexing completed on 2024-11-10 04:57:11

0001 /*
0002     KWin - the KDE window manager
0003     This file is part of the KDE project.
0004 
0005     SPDX-FileCopyrightText: 2012 Martin Gräßlin <mgraesslin@kde.org>
0006 
0007     SPDX-License-Identifier: GPL-2.0-or-later
0008 */
0009 
0010 var applyTo = readConfig("ApplyTo", true);
0011 var whitelist = readConfig("Whitelist", "vlc, xv, vdpau, smplayer, dragon, xine, ffplay, mplayer").toString().toLowerCase().split(",");
0012 for (i = 0; i < whitelist.length; ++i)
0013     whitelist[i] = whitelist[i].trim();
0014 
0015 var ignore = readConfig("Ignore", false);
0016 var blacklist = readConfig("Blacklist", "").toString().toLowerCase().split(",");
0017 for (i = 0; i < blacklist.length; ++i)
0018     blacklist[i] = blacklist[i].trim();
0019 
0020 
0021 function isVideoPlayer(client) {
0022     if (applyTo == true && whitelist.indexOf(client.resourceClass.toString()) < 0)
0023         return false; // required whitelist match failed
0024     if (ignore == true && blacklist.indexOf(client.resourceClass.toString()) > -1)
0025         return false; // required blacklist match hit
0026     return true;
0027 }
0028 
0029 function setup(window) {
0030     window.fullScreenChanged.connect(() => {
0031         if (window.fullScreen && isVideoPlayer(window)) {
0032             window.frameGeometry = workspace.clientArea(KWin.FullArea, window);
0033         }
0034     });
0035 }
0036 
0037 workspace.windowAdded.connect(setup);
0038 workspace.windowList().forEach(setup);