From b3adfd5c1809e40b2eae89f2e445536df8bf612b Mon Sep 17 00:00:00 2001
From: Fabian Homborg <FHomborg@gmail.com>
Date: Sun, 17 Nov 2013 22:51:34 +0100
Subject: [PATCH] Simplify windowShown by waiting for it before adding the
 client

Not sure wS is worth it, actually - I still get graphics issues with
e.g. steam
---
 contents/code/tilelist.js | 27 +++++++++------------------
 1 file changed, 9 insertions(+), 18 deletions(-)

diff --git a/contents/code/tilelist.js b/contents/code/tilelist.js
index 0f4d96b..9573744 100644
--- a/contents/code/tilelist.js
+++ b/contents/code/tilelist.js
@@ -43,7 +43,12 @@ function TileList() {
     // new/deleted tiles
     var self = this;
     workspace.clientAdded.connect(function(client) {
-		self._onClientAdded(client);
+		// Delay adding until the window is actually shown
+		// This prevents graphics bugs
+		// due to resizing before the pixmap is created (or something like that)
+		client.windowShown.connect(function() {
+			self._onClientAdded(client);
+		});
     });
     workspace.clientRemoved.connect(function(client) {
 		self._onClientRemoved(client);
@@ -91,25 +96,11 @@ TileList.prototype.connectSignals = function(client) {
         return self.getTile(client);
     };
     client.geometryShapeChanged.connect(function() {
-		if (client.tiling_shown == true) {
-			var tile = getTile(client);
-			if (tile != null) {
-				tile.onClientGeometryChanged(client);
-			}
+		var tile = getTile(client);
+		if (tile != null) {
+			tile.onClientGeometryChanged(client);
 		}
     });
-	client.windowShown.connect(function() {
-		// Delay adding until the window is actually shown
-		// This prevents graphics bugs
-		// due to resizing before the pixmap is created (or something like that)
-		if (client.tiling_shown != true) {
-			client.tiling_shown = true;
-			var tile = getTile(client);
-			if (tile != null) {
-				tile.onClientGeometryChanged(client);
-			}
-		}
-	});
     client.clientStartUserMovedResized.connect(function() {
 		var tile = getTile(client);
 		if (tile != null) {
-- 
GitLab