├── README.md ├── contents └── code │ └── main.js └── metadata.desktop /README.md: -------------------------------------------------------------------------------- 1 | # No border on maximized windows 2 | 3 | Unfortunetly this feature is broken with Plasma 5. This simple script aims to do the job instead. -------------------------------------------------------------------------------- /contents/code/main.js: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | noBorderOnMaximized - a KWin Script 3 | 4 | Copyright (C) 2015 Tamás Gere 5 | 6 | This program is free software; you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation; either version 2 of the License, or 9 | (at your option) any later version. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with this program. If not, see . 18 | *********************************************************************/ 19 | var borderless = new Array(); 20 | function d(obj) { 21 | for (i in obj) print('debug: ['+i+']: '+obj[i]); 22 | } 23 | function noBorderOnMaximized(client, h, v) { 24 | if (client.maximizable && h && v) { 25 | //print('Maximized: "'+client.caption+'"'); 26 | if (client.noBorder == false) { 27 | //print('Removing border: "'+client.caption+'"'); 28 | borderless[borderless.length] = client; 29 | client.noBorder = true; 30 | } 31 | } else { 32 | //print('No longer maximized: "'+client.caption+'"'); 33 | var found = borderless.indexOf(client); 34 | if (found != -1 || client.noBorder == true) { 35 | //print('Restoring border: "'+client.caption+'"'); 36 | client.noBorder = false; 37 | borderless.splice(found, 1); 38 | } 39 | } 40 | } 41 | 42 | workspace.clientMaximizeSet.connect(noBorderOnMaximized); 43 | 44 | var lastAdded; 45 | var checkMaximized = function() { 46 | var area = workspace.clientArea(KWin.MaximizeArea, workspace.activeScreen, workspace.currentDesktop); 47 | if (lastAdded.maximizable == true && lastAdded.normalWindow == true && lastAdded.width >= (area.width - 5) && lastAdded.height >= (area.height - 40)) { 48 | print('Initially maximized: '+lastAdded.caption); 49 | 50 | // re-check active client: 51 | var activeClient = workspace.activeClient; 52 | if (activeClient != lastAdded) workspace.activeClient = lastAdded; 53 | workspace.slotWindowMaximize(); 54 | workspace.slotWindowMaximize(); 55 | if (activeClient != lastAdded) workspace.activeClient = activeClient; 56 | 57 | //execute our func 58 | noBorderOnMaximized(lastAdded, true, true); 59 | } else { 60 | print('Initially NOT maximized: '+lastAdded.caption); 61 | } 62 | }; 63 | 64 | var tim = new QTimer; 65 | tim.singleShot = true; 66 | tim.timeout.connect(checkMaximized); 67 | 68 | workspace.clientAdded.connect(function(client) { 69 | lastAdded = client; 70 | checkMaximized(); 71 | //tim.start(1); // wait until the client is actually mapped and activ(atabl)e 72 | //client['clientMaximizedStateChanged(KWin::Client*,bool,bool)'].connect(noBorderOnMaximized); 73 | }); 74 | 75 | workspace.clientRemoved.connect(function(client) { 76 | noBorderOnMaximized(client, false, false); 77 | }); -------------------------------------------------------------------------------- /metadata.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Name=No border on maximized windows 3 | Comment=Unfortunetly this feature is broken with Plasma 5. This simple script aims to do the job instead. 4 | Icon=preferences-system-windows-script-test 5 | 6 | Type=Service 7 | 8 | X-Plasma-API=javascript 9 | X-Plasma-MainScript=code/main.js 10 | 11 | X-KDE-PluginInfo-Author=Tamás Gere 12 | X-KDE-PluginInfo-Email=gt@kani.hu 13 | X-KDE-PluginInfo-Name=noBorderOnMaximized 14 | X-KDE-PluginInfo-Version=1.3 15 | 16 | X-KDE-PluginInfo-Depends= 17 | X-KDE-PluginInfo-License=GPL 18 | X-KDE-ServiceTypes=KWin/Script 19 | X-KDE-Library=kcm_kwin4_genericscripted 20 | X-KDE-PluginKeyword=noBorderOnMaximized 21 | X-KDE-ParentComponents=noBorderOnMaximized --------------------------------------------------------------------------------