diff --git a/contents/code/tile.js b/contents/code/tile.js index 47b5ef0b16c932d515fd46584c41fa2645842e18..cca4fe82ef7aced77616fb8d7a3a1d21165f1866 100644 --- a/contents/code/tile.js +++ b/contents/code/tile.js @@ -178,6 +178,12 @@ Tile.prototype.onClientGeometryChanged = function(client) { if (client == null) { return; } + if (client.deleted == true) { + return; + } + if (client.managed == false) { + return; + } if (client.tiling_MoveResize == true) { client.tiling_MoveResize = false; return; @@ -199,16 +205,27 @@ Tile.prototype.onClientGeometryChanged = function(client) { if (this._moving || this._resizing) { return; } - if (this.rectangle != null) { + if (this.rectangle != null && client.tiling_shown == true) { if (client.geometry.x != this.rectangle.x || client.geometry.y != this.rectangle.y || client.geometry.width != this.rectangle.width || client.geometry.height != this.rectangle.height) { client.tiling_MoveResize = true; + /* + if (client.minSize.w > this.rectangle.width) { + this.rectangle.width = client.minSize.w; + } + if (client.minSize.h > this.rectangle.height) { + this.rectangle.height = client.minSize.h; + } + */ client.geometry = Qt.rect(this.rectangle.x, this.rectangle.y, this.rectangle.width, this.rectangle.height); + // This could take a _lot_ of processing power and battery life + // TEST + client.addRepaint(this.rectangle); } } this.geometryChanged.emit(); diff --git a/contents/code/tilelist.js b/contents/code/tilelist.js index f9e755ec383e3ba37a6b95de8e8f23d80f05506c..10cfdfb4db9732ef9ef0ff75b41df42e3398998a 100644 --- a/contents/code/tilelist.js +++ b/contents/code/tilelist.js @@ -95,6 +95,18 @@ TileList.prototype.connectSignals = function(client) { 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) { @@ -284,8 +296,8 @@ TileList.prototype._removeTile = function(tileIndex) { }; /** - * Returns true for clients which shall not be handled by the tiling script at - * all, e.g. the panel. + * Returns true for clients which shall never be handled by the tiling script, + * e.g. panels, dialogs or the user-defined apps */ TileList._isIgnored = function(client) { // Application workarounds should be put here diff --git a/contents/code/tilingmanager.js b/contents/code/tilingmanager.js index 0f3c60e73da324c8f687738820c055a6ad0a3d54..fa01b5a094dbfa832d514531fde667267357987d 100644 --- a/contents/code/tilingmanager.js +++ b/contents/code/tilingmanager.js @@ -116,6 +116,7 @@ function TilingManager() { var existingClients = workspace.clientList(); existingClients.forEach(function(client) { self.tiles._onClientRemoved(client); + client.tiling_shown = true; self.tiles.addClient(client); // Don't reset floating so we don't lose the value over restarts //client.tiling_floating = null;