diff --git a/tiling/tile.cpp b/tiling/tile.cpp index ee1f848a09..01bf6cefa2 100644 --- a/tiling/tile.cpp +++ b/tiling/tile.cpp @@ -35,11 +35,10 @@ Tile::Tile(Client *c, const QRect& area) : m_client(c), m_floating(false) { + Q_ASSERT(c != NULL); setGeometry(area); - if (c) { - m_prevGeom = c->geometry(); - } - if (c && !c->isResizable()) + m_prevGeom = c->geometry(); + if (!c->isResizable()) floatTile(); } @@ -60,8 +59,6 @@ Tile::Tile(const Tile& orig) Tile::~Tile() { restorePreviousGeometry(); - - m_client = NULL; } void Tile::commit() @@ -115,11 +112,6 @@ void Tile::unfloatTile() void Tile::restorePreviousGeometry() { - // why this check? - // sometimes we remove a Tile, but don't want to remove the children - // so the children are set to NULL. In this case leaf() will return - // true but m_client will still be null - if (!m_client) return; if (m_prevGeom.isNull()) { QRect area = m_client->workspace()->clientArea(PlacementArea, m_client); m_client->workspace()->place(m_client, area); diff --git a/tiling/tiling.cpp b/tiling/tiling.cpp index 0b8fb95e66..c56ff8422e 100644 --- a/tiling/tiling.cpp +++ b/tiling/tiling.cpp @@ -187,16 +187,17 @@ bool Tiling::tileable(Client* c) void Tiling::belowCursor() { - // TODO + // TODO ... "WHAT?" remove? What's a parameterless void function supposed to do? } Tile* Tiling::getNiceTile() const { if (!isEnabled()) return NULL; + if (!m_workspace->activeClient()) return NULL; if (!m_tilingLayouts.value(m_workspace->activeClient()->desktop())) return NULL; return m_tilingLayouts[ m_workspace->activeClient()->desktop()]->findTile(m_workspace->activeClient()); - // TODO + // TODO ... WHAT? } void Tiling::updateAllTiles() @@ -460,6 +461,8 @@ void Tiling::slotMoveTileBottom() void Tiling::slotToggleFloating() { Client *c = m_workspace->activeClient(); + if (!c) + return; if (m_tilingLayouts.value(c->desktop())) { m_tilingLayouts[ c->desktop()]->toggleFloatTile(c); } diff --git a/tiling/tilinglayout.cpp b/tiling/tilinglayout.cpp index 0e1d642ad5..a42c38f126 100644 --- a/tiling/tilinglayout.cpp +++ b/tiling/tilinglayout.cpp @@ -217,7 +217,7 @@ Tile* TilingLayout::findTileBelowPoint(const QPoint &p) const void TilingLayout::commit() { foreach (Tile * t, m_tiles) - t->commit(); + t->commit(); } /*