scene: Don't hide closed windows
If a closed window is kept alive, it means that somebody needs to animate it and therefore it should be visible. Otherwise the window would be destroyed and its item would be removed from the scene. This change makes the WindowItem not change its visibility if the associated window is closed. If the window had been invisible before it was closed, the item would be invisible; if the window had been visible before it was closed, the item would be visible.
This commit is contained in:
parent
b90ae2f8fc
commit
eea8200479
11 changed files with 8 additions and 30 deletions
|
@ -258,7 +258,7 @@ quint64 AnimationEffect::p_animate(EffectWindow *w, Attribute a, uint meta, int
|
|||
AniData &animation = it->first.last();
|
||||
animation.id = ret_id;
|
||||
|
||||
animation.visibleRef = EffectWindowVisibleRef(w, EffectWindow::PAINT_DISABLED_BY_MINIMIZE | EffectWindow::PAINT_DISABLED_BY_DESKTOP | EffectWindow::PAINT_DISABLED_BY_DELETE | EffectWindow::PAINT_DISABLED);
|
||||
animation.visibleRef = EffectWindowVisibleRef(w, EffectWindow::PAINT_DISABLED_BY_MINIMIZE | EffectWindow::PAINT_DISABLED_BY_DESKTOP | EffectWindow::PAINT_DISABLED);
|
||||
animation.timeLine.setDirection(TimeLine::Forward);
|
||||
animation.timeLine.setDuration(std::chrono::milliseconds(ms));
|
||||
animation.timeLine.setEasingCurve(curve);
|
||||
|
|
|
@ -2295,14 +2295,12 @@ public:
|
|||
enum {
|
||||
/** Window will not be painted */
|
||||
PAINT_DISABLED = 1 << 0,
|
||||
/** Window will not be painted because it is deleted */
|
||||
PAINT_DISABLED_BY_DELETE = 1 << 1,
|
||||
/** Window will not be painted because of which desktop it's on */
|
||||
PAINT_DISABLED_BY_DESKTOP = 1 << 2,
|
||||
PAINT_DISABLED_BY_DESKTOP = 1 << 1,
|
||||
/** Window will not be painted because it is minimized */
|
||||
PAINT_DISABLED_BY_MINIMIZE = 1 << 3,
|
||||
PAINT_DISABLED_BY_MINIMIZE = 1 << 2,
|
||||
/** Window will not be painted because it's not on the current activity */
|
||||
PAINT_DISABLED_BY_ACTIVITY = 1 << 4
|
||||
PAINT_DISABLED_BY_ACTIVITY = 1 << 3,
|
||||
};
|
||||
|
||||
explicit EffectWindow();
|
||||
|
|
|
@ -179,7 +179,6 @@ void FallApartEffect::slotWindowClosed(EffectWindow *c)
|
|||
FallApartAnimation &animation = windows[c];
|
||||
animation.progress = 0;
|
||||
animation.deletedRef = EffectWindowDeletedRef(c);
|
||||
animation.visibleRef = EffectWindowVisibleRef(c, EffectWindow::PAINT_DISABLED_BY_DELETE);
|
||||
|
||||
redirect(c);
|
||||
}
|
||||
|
|
|
@ -17,7 +17,6 @@ namespace KWin
|
|||
struct FallApartAnimation
|
||||
{
|
||||
EffectWindowDeletedRef deletedRef;
|
||||
EffectWindowVisibleRef visibleRef;
|
||||
std::chrono::milliseconds lastPresentTime = std::chrono::milliseconds::zero();
|
||||
qreal progress = 0;
|
||||
};
|
||||
|
|
|
@ -274,7 +274,6 @@ void GlideEffect::windowClosed(EffectWindow *w)
|
|||
|
||||
GlideAnimation &animation = m_animations[w];
|
||||
animation.deletedRef = EffectWindowDeletedRef(w);
|
||||
animation.visibleRef = EffectWindowVisibleRef(w, EffectWindow::PAINT_DISABLED_BY_DELETE);
|
||||
animation.timeLine.reset();
|
||||
animation.timeLine.setDirection(TimeLine::Forward);
|
||||
animation.timeLine.setDuration(m_duration);
|
||||
|
|
|
@ -21,7 +21,6 @@ namespace KWin
|
|||
struct GlideAnimation
|
||||
{
|
||||
EffectWindowDeletedRef deletedRef;
|
||||
EffectWindowVisibleRef visibleRef;
|
||||
TimeLine timeLine;
|
||||
};
|
||||
|
||||
|
|
|
@ -206,7 +206,6 @@ void SheetEffect::slotWindowClosed(EffectWindow *w)
|
|||
|
||||
Animation &animation = m_animations[w];
|
||||
animation.deletedRef = EffectWindowDeletedRef(w);
|
||||
animation.visibleRef = EffectWindowVisibleRef(w, EffectWindow::PAINT_DISABLED_BY_DELETE);
|
||||
animation.timeLine.reset();
|
||||
animation.parentY = 0;
|
||||
animation.timeLine.setDuration(m_duration);
|
||||
|
|
|
@ -52,7 +52,6 @@ private:
|
|||
struct Animation
|
||||
{
|
||||
EffectWindowDeletedRef deletedRef;
|
||||
EffectWindowVisibleRef visibleRef;
|
||||
TimeLine timeLine;
|
||||
int parentY;
|
||||
};
|
||||
|
|
|
@ -543,7 +543,7 @@ void SlidingPopupsEffect::slideOut(EffectWindow *w)
|
|||
if (w->isDeleted()) {
|
||||
animation.deletedRef = EffectWindowDeletedRef(w);
|
||||
}
|
||||
animation.visibleRef = EffectWindowVisibleRef(w, EffectWindow::PAINT_DISABLED | EffectWindow::PAINT_DISABLED_BY_DELETE);
|
||||
animation.visibleRef = EffectWindowVisibleRef(w, EffectWindow::PAINT_DISABLED);
|
||||
animation.kind = AnimationKind::Out;
|
||||
animation.timeLine.setDirection(TimeLine::Backward);
|
||||
animation.timeLine.setDuration((*dataIt).slideOutDuration);
|
||||
|
|
|
@ -84,9 +84,6 @@ void WindowItem::refVisible(int reason)
|
|||
if (reason & PAINT_DISABLED_BY_HIDDEN) {
|
||||
m_forceVisibleByHiddenCount++;
|
||||
}
|
||||
if (reason & PAINT_DISABLED_BY_DELETE) {
|
||||
m_forceVisibleByDeleteCount++;
|
||||
}
|
||||
if (reason & PAINT_DISABLED_BY_DESKTOP) {
|
||||
m_forceVisibleByDesktopCount++;
|
||||
}
|
||||
|
@ -105,10 +102,6 @@ void WindowItem::unrefVisible(int reason)
|
|||
Q_ASSERT(m_forceVisibleByHiddenCount > 0);
|
||||
m_forceVisibleByHiddenCount--;
|
||||
}
|
||||
if (reason & PAINT_DISABLED_BY_DELETE) {
|
||||
Q_ASSERT(m_forceVisibleByDeleteCount > 0);
|
||||
m_forceVisibleByDeleteCount--;
|
||||
}
|
||||
if (reason & PAINT_DISABLED_BY_DESKTOP) {
|
||||
Q_ASSERT(m_forceVisibleByDesktopCount > 0);
|
||||
m_forceVisibleByDesktopCount--;
|
||||
|
@ -150,11 +143,6 @@ bool WindowItem::computeVisibility() const
|
|||
if (waylandServer() && waylandServer()->isScreenLocked()) {
|
||||
return m_window->isLockScreen() || m_window->isInputMethod() || m_window->isLockScreenOverlay();
|
||||
}
|
||||
if (m_window->isDeleted()) {
|
||||
if (m_forceVisibleByDeleteCount == 0) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (!m_window->isOnCurrentDesktop()) {
|
||||
if (m_forceVisibleByDesktopCount == 0) {
|
||||
return false;
|
||||
|
|
|
@ -36,10 +36,9 @@ class KWIN_EXPORT WindowItem : public Item
|
|||
public:
|
||||
enum {
|
||||
PAINT_DISABLED_BY_HIDDEN = 1 << 0,
|
||||
PAINT_DISABLED_BY_DELETE = 1 << 1,
|
||||
PAINT_DISABLED_BY_DESKTOP = 1 << 2,
|
||||
PAINT_DISABLED_BY_MINIMIZE = 1 << 3,
|
||||
PAINT_DISABLED_BY_ACTIVITY = 1 << 4
|
||||
PAINT_DISABLED_BY_DESKTOP = 1 << 1,
|
||||
PAINT_DISABLED_BY_MINIMIZE = 1 << 2,
|
||||
PAINT_DISABLED_BY_ACTIVITY = 1 << 3,
|
||||
};
|
||||
|
||||
~WindowItem() override;
|
||||
|
@ -80,7 +79,6 @@ private:
|
|||
std::unique_ptr<ShadowItem> m_shadowItem;
|
||||
std::optional<int> m_elevation;
|
||||
int m_forceVisibleByHiddenCount = 0;
|
||||
int m_forceVisibleByDeleteCount = 0;
|
||||
int m_forceVisibleByDesktopCount = 0;
|
||||
int m_forceVisibleByMinimizeCount = 0;
|
||||
int m_forceVisibleByActivityCount = 0;
|
||||
|
|
Loading…
Reference in a new issue