effects: Don't emit showingDesktopChanged when animated is false

This commit is contained in:
Fushan Wen 2022-02-04 22:13:47 +08:00
parent c85bb35c98
commit 0ded63c464

View file

@ -139,8 +139,12 @@ EffectsHandlerImpl::EffectsHandlerImpl(Compositor *compositor, Scene *scene)
Workspace *ws = Workspace::self(); Workspace *ws = Workspace::self();
VirtualDesktopManager *vds = VirtualDesktopManager::self(); VirtualDesktopManager *vds = VirtualDesktopManager::self();
connect(ws, &Workspace::showingDesktopChanged, connect(ws, &Workspace::showingDesktopChanged, this,
this, &EffectsHandlerImpl::showingDesktopChanged); [this](bool showing, bool animated) {
if (animated) {
Q_EMIT showingDesktopChanged(showing);
}
});
connect(ws, &Workspace::currentDesktopChanged, this, [this](int old, AbstractClient *c) { connect(ws, &Workspace::currentDesktopChanged, this, [this](int old, AbstractClient *c) {
const int newDesktop = VirtualDesktopManager::self()->current(); const int newDesktop = VirtualDesktopManager::self()->current();
if (old != 0 && newDesktop != old) { if (old != 0 && newDesktop != old) {