cache blocked tabgroup state updates and do not check group breaking issues not being part of the updated states
BUG: 300847 FIXED-IN: 4.9 REVIEW: 105114
This commit is contained in:
parent
11f28732db
commit
8ee66eff55
2 changed files with 13 additions and 4 deletions
14
tabgroup.cpp
14
tabgroup.cpp
|
@ -32,6 +32,7 @@ TabGroup::TabGroup(Client *c)
|
|||
, m_minSize(c->minSize())
|
||||
, m_maxSize(c->maxSize())
|
||||
, m_stateUpdatesBlocked(0)
|
||||
, m_pendingUpdates(TabGroup::None)
|
||||
{
|
||||
QIcon icon(c->icon());
|
||||
icon.addPixmap(c->miniIcon());
|
||||
|
@ -291,8 +292,13 @@ void TabGroup::blockStateUpdates(bool more) {
|
|||
|
||||
void TabGroup::updateStates(Client* main, States states, Client* only)
|
||||
{
|
||||
if (m_stateUpdatesBlocked > 0)
|
||||
if (m_stateUpdatesBlocked > 0) {
|
||||
m_pendingUpdates |= states;
|
||||
return;
|
||||
}
|
||||
|
||||
states |= m_pendingUpdates;
|
||||
m_pendingUpdates = TabGroup::None;
|
||||
|
||||
ClientList toBeRemoved;
|
||||
for (ClientList::const_iterator i = m_clients.constBegin(), end = m_clients.constEnd(); i != end; ++i) {
|
||||
|
@ -322,8 +328,9 @@ void TabGroup::updateStates(Client* main, States states, Client* only)
|
|||
if (c->desktop() != main->desktop())
|
||||
c->setDesktop(main->desktop());
|
||||
}
|
||||
if ((states & Activity) && c->activities() != main->activities())
|
||||
if ((states & Activity) && c->activities() != main->activities()) {
|
||||
c->setOnActivities(main->activities());
|
||||
}
|
||||
if (states & Layer) {
|
||||
if (c->keepAbove() != main->keepAbove())
|
||||
c->setKeepAbove(main->keepAbove());
|
||||
|
@ -332,7 +339,8 @@ void TabGroup::updateStates(Client* main, States states, Client* only)
|
|||
}
|
||||
|
||||
// If it's not possible to have the same states then ungroup them, TODO: Check all states
|
||||
if (c->geometry() != main->geometry() || c->desktop() != main->desktop())
|
||||
if (((states & Geometry) && c->geometry() != main->geometry()) ||
|
||||
((states & Desktop) && c->desktop() != main->desktop()))
|
||||
toBeRemoved << c;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -57,7 +57,7 @@ public:
|
|||
~TabGroup();
|
||||
|
||||
enum State {
|
||||
Minimized = 1<<0, Maximized = 1<<1, Shaded = 1<<2,
|
||||
None = 0, Minimized = 1<<0, Maximized = 1<<1, Shaded = 1<<2,
|
||||
Geometry = 1<<3, Desktop = 1<<4, Activity = 1<<5,
|
||||
Layer = 1<<6, QuickTile = 1<<7, All = 0xffffffff
|
||||
};
|
||||
|
@ -164,6 +164,7 @@ private:
|
|||
QSize m_minSize;
|
||||
QSize m_maxSize;
|
||||
int m_stateUpdatesBlocked;
|
||||
States m_pendingUpdates;
|
||||
};
|
||||
|
||||
inline bool TabGroup::contains(Client* c) const
|
||||
|
|
Loading…
Reference in a new issue