From 872083d9cb24a70643738775f7ec257bc3be604a Mon Sep 17 00:00:00 2001
From: Fabian Homborg <FHomborg@gmail.com>
Date: Mon, 21 Oct 2013 18:29:37 +0200
Subject: [PATCH] Add option to disable borders.

It is _strongly_ recommended for now to use FocusUnderMouse with this,
as it's otherwise almost impossible to tell which window is focussed.
---
 contents/code/tilelist.js      | 8 +++++++-
 contents/code/tilingmanager.js | 1 +
 contents/config/main.xml       | 4 ++++
 contents/ui/config.ui          | 7 +++++++
 4 files changed, 19 insertions(+), 1 deletion(-)

diff --git a/contents/code/tilelist.js b/contents/code/tilelist.js
index c27a730..35dee90 100644
--- a/contents/code/tilelist.js
+++ b/contents/code/tilelist.js
@@ -62,6 +62,10 @@ TileList.prototype.addClient = function(client) {
 		client.tileIndex = - 1;
         return;
     }
+	var noBorder = readConfig("noBorder", false);
+	if (noBorder == true) {
+		client.noBorder = true;
+	}
     var self = this;
     client.tabGroupChanged.connect(function() {
         self._onClientTabGroupChanged(client);
@@ -125,7 +129,6 @@ TileList.prototype.addClient = function(client) {
 			this.tiles[tileIndex].clients.push(client);
 		}
     } else {
-		print("Adding client",client.resourceClass.toString(), "to a new tile");
         // If not, create a new tile
         this._addTile(client);
     }
@@ -186,6 +189,9 @@ TileList.prototype._onClientRemoved = function(client) {
         tile.clients.splice(tile.clients.indexOf(client), 1);
     }
 	client.tiling_tileIndex = - 1;
+	if (client.tiling_floating == true) {
+		client.noBorder = false;
+	}
 };
 
 TileList.prototype._onClientTabGroupChanged = function(client) {
diff --git a/contents/code/tilingmanager.js b/contents/code/tilingmanager.js
index dbdad1b..b7d288c 100644
--- a/contents/code/tilingmanager.js
+++ b/contents/code/tilingmanager.js
@@ -118,6 +118,7 @@ function TilingManager() {
     var existingClients = workspace.clientList();
     existingClients.forEach(function(client) {
 		self.tiles._onClientRemoved(client);
+		self.tiles.addClient(client);
 		// Don't reset floating so we don't lose the value over restarts
         //client.tiling_floating = null;
     });
diff --git a/contents/config/main.xml b/contents/config/main.xml
index 12a8f8a..4c0d710 100644
--- a/contents/config/main.xml
+++ b/contents/config/main.xml
@@ -9,5 +9,9 @@
 		  <label>The windows (by class) that should float</label>
 		  <default>yakuake,Plasma,Plasma-desktop,krunner,plugin-container</default>
         </entry>
+		<entry name="noBorder" type="bool">
+		  <label>Should borders be removed? FocusUnderMouse recommended</label>
+		  <default>false</default>
+		</entry>
     </group>
 </kcfg>
diff --git a/contents/ui/config.ui b/contents/ui/config.ui
index b685b09..342768b 100644
--- a/contents/ui/config.ui
+++ b/contents/ui/config.ui
@@ -31,6 +31,13 @@
      </property>
     </widget>
    </item>
+   <item>
+    <widget class="QCheckBox" name="kcfg_noBorder">
+     <property name="text">
+      <string>No Borders</string>
+     </property>
+    </widget>
+   </item>
   </layout>
  </widget>
  <customwidgets>
-- 
GitLab