Remove tiling dependency from Client
The direct method calls from class Client were removed and replaced by connecting to the appropriate signals emitted by class Client. The affected methods in class Tiling are notifyTilingWindowMinimizeToggle() and updateAllTiles() which are now private Q_SLOTS. Including tiling.h in class Client is no longer needed and was removed.
This commit is contained in:
parent
b1e3c7ba38
commit
85c5439b5d
3 changed files with 9 additions and 13 deletions
|
@ -47,7 +47,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
#include "notifications.h"
|
||||
#include "rules.h"
|
||||
#include "shadow.h"
|
||||
#include "tiling/tiling.h"
|
||||
#include "deleted.h"
|
||||
#include "paintredirector.h"
|
||||
#ifdef KWIN_BUILD_TABBOX
|
||||
|
@ -951,9 +950,6 @@ void Client::minimize(bool avoid_animation)
|
|||
// TODO: merge signal with s_minimized
|
||||
emit clientMinimized(this, !avoid_animation);
|
||||
|
||||
// when tiling, request a rearrangement
|
||||
workspace()->tiling()->notifyTilingWindowMinimizeToggled(this);
|
||||
|
||||
// Update states of all other windows in this group
|
||||
if (clientGroup())
|
||||
clientGroup()->updateStates(this);
|
||||
|
@ -979,12 +975,8 @@ void Client::unminimize(bool avoid_animation)
|
|||
updateAllowedActions();
|
||||
workspace()->updateMinimizedOfTransients(this);
|
||||
updateWindowRules();
|
||||
workspace()->tiling()->updateAllTiles();
|
||||
emit clientUnminimized(this, !avoid_animation);
|
||||
|
||||
// when tiling, request a rearrangement
|
||||
workspace()->tiling()->notifyTilingWindowMinimizeToggled(this);
|
||||
|
||||
// Update states of all other windows in this group
|
||||
if (clientGroup())
|
||||
clientGroup()->updateStates(this);
|
||||
|
|
|
@ -145,6 +145,10 @@ void Tiling::createTile(Client* c)
|
|||
}
|
||||
tilingLayouts[c->desktop()]->addTile(t);
|
||||
tilingLayouts[c->desktop()]->commit();
|
||||
// if tiling is activated, connect to Client's signals and react with rearrangement when (un)minimizing
|
||||
connect(c, SIGNAL(clientMinimized(KWin::Client*,bool)), this, SLOT(notifyTilingWindowMinimizeToggled(KWin::Client*)));
|
||||
connect(c, SIGNAL(clientUnminimized(KWin::Client*,bool)), this, SLOT(notifyTilingWindowMinimizeToggled(KWin::Client*)));
|
||||
connect(c, SIGNAL(s_unminimized()), this, SLOT(updateAllTiles()));
|
||||
}
|
||||
|
||||
void Tiling::removeTile(Client *c)
|
||||
|
@ -299,7 +303,7 @@ void Tiling::notifyTilingWindowActivated(Client *c)
|
|||
}
|
||||
}
|
||||
|
||||
void Tiling::notifyTilingWindowMinimizeToggled(Client *c)
|
||||
void Tiling::notifyTilingWindowMinimizeToggled(KWin::Client* c)
|
||||
{
|
||||
if (tilingLayouts.value(c->desktop())) {
|
||||
tilingLayouts[ c->desktop()]->clientMinimizeToggled(c);
|
||||
|
|
|
@ -41,9 +41,6 @@ public:
|
|||
bool tilingEnabled() const;
|
||||
void setTilingEnabled(bool tiling);
|
||||
bool tileable(Client *c);
|
||||
// updates geometry of tiles on all desktops,
|
||||
// this rearranges the tiles.
|
||||
void updateAllTiles();
|
||||
const QVector< TilingLayout* >& getTilingLayouts() const;
|
||||
void initShortcuts(KActionCollection* keys);
|
||||
|
||||
|
@ -57,7 +54,6 @@ public:
|
|||
void notifyTilingWindowMoveDone(Client *c, const QRect &moveResizeGeom, const QRect &orig, bool canceled);
|
||||
void notifyTilingWindowDesktopChanged(Client *c, int old_desktop);
|
||||
void notifyTilingWindowActivated(Client *c);
|
||||
void notifyTilingWindowMinimizeToggled(Client *c);
|
||||
void notifyTilingWindowMaximized(Client *c, KDecorationDefines::WindowOperation op);
|
||||
|
||||
KDecorationDefines::Position supportedTilingResizeMode(Client *c, KDecorationDefines::Position currentMode);
|
||||
|
@ -105,6 +101,10 @@ private:
|
|||
QVector<TilingLayout *> tilingLayouts;
|
||||
private Q_SLOTS:
|
||||
void slotResizeTilingLayouts();
|
||||
void notifyTilingWindowMinimizeToggled(KWin::Client *c);
|
||||
// updates geometry of tiles on all desktops,
|
||||
// this rearranges the tiles.
|
||||
void updateAllTiles();
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue