From ed3a0e81c01f33ad79b4a1a0563202af9b357ea4 Mon Sep 17 00:00:00 2001
From: Fabian Homborg <FHomborg@gmail.com>
Date: Sat, 28 Dec 2013 17:29:48 +0100
Subject: [PATCH] Always resync properties when adding a tile to a layout

---
 commentary.org          |  5 +++++
 contents/code/tiling.js | 12 ++++--------
 2 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/commentary.org b/commentary.org
index ed71301..a7529fb 100644
--- a/commentary.org
+++ b/commentary.org
@@ -17,6 +17,8 @@
    This leads to graphics bugs
 ** TODO Resolution changes
    Almost possible, but clientArea returns the _old_ resolution
+** TODO FFM bug when unminimizing
+   Possibly related to keepAbove/keepBelow
 * DONE Avoid struts
   Almost finished, but doesn't directly react to changes
   Needs an additional kwin signal
@@ -48,6 +50,9 @@
    Each client belongs to multiple activities, but is on the same desktop on each
    There can only be one activity at the same time
 *** Needs changes in tilingmanager (large) and maybe tile and tilelist
+** Switch to BSP/BinaryTree-based tiling
+   This requires a rather large change, but should add flawless resizing without special code in the layouts
+   and should make layouts much simpler to write
 * TODO Report
 ** Bugs
 *** ClientArea doesn't update
diff --git a/contents/code/tiling.js b/contents/code/tiling.js
index 02635f7..fc75b67 100644
--- a/contents/code/tiling.js
+++ b/contents/code/tiling.js
@@ -94,23 +94,19 @@ Tiling.prototype.addTile = function(tile, x, y) {
 		} else {
 			if (tile.tileIndex > -1) {
 				this.tiles.splice(tile.tileIndex, 0, tile);
-				for (i = 0; i < this.tiles.length; i++) {
-					this.tiles[i].tileIndex = i;
-					this.tiles[i].syncCustomProperties();
-				}
 			} else {
 				if (readConfig("startAsMaster", false) == true) {
 					tile.tileIndex = 0;
 					this.tiles.splice(tile.tileIndex, 0, tile);
-					for (i = 0; i < this.tiles.length; i++) {
-						this.tiles[i].tileIndex = i;
-						this.tiles[i].syncCustomProperties();
-					}
 				} else {
 					tile.tileIndex = this.tiles.length;
 					this.tiles.push(tile);
 				}
 			}
+			for (i = 0; i < this.tiles.length; i++) {
+				this.tiles[i].tileIndex = i;
+				this.tiles[i].syncCustomProperties();
+			}
 		}
 		this._updateAllTiles();
 	} catch(err) {
-- 
GitLab