Emit X11Window::{windowShown,windowHidden} only when hidden propery changes

Currently, X11Window emits Window::windowShown and Window::windowHidden
signals differently than the WaylandWindow. On the other hand, at quick
glance, there's no reason why it has to work like this, so let's make
X11Window behave similarly to WaylandWindow. This lets us simplify code
and potentially unvirtualize Window::isHiddenInternal() in the future.
It also makes X11Window::internalHide and X11Window::internalKeep more
reusable as it doesn't handle focus anymore.
This commit is contained in:
Vlad Zahorodnii 2023-05-30 12:52:16 +03:00
parent 417a7f3601
commit bc43be9c00

View file

@ -1625,6 +1625,8 @@ void X11Window::hideClient()
}
hidden = true;
updateVisibility();
workspace()->windowHidden(this);
Q_EMIT windowHidden(this);
}
void X11Window::showClient()
@ -1634,6 +1636,7 @@ void X11Window::showClient()
}
hidden = false;
updateVisibility();
Q_EMIT windowShown(this);
}
bool X11Window::setupCompositing()
@ -1884,7 +1887,6 @@ void X11Window::internalShow()
m_decoInputExtent.map();
updateHiddenPreview();
}
Q_EMIT windowShown(this);
}
void X11Window::internalHide()
@ -1900,8 +1902,6 @@ void X11Window::internalHide()
if (old == Kept) {
updateHiddenPreview();
}
workspace()->windowHidden(this);
Q_EMIT windowHidden(this);
}
void X11Window::internalKeep()
@ -1920,7 +1920,6 @@ void X11Window::internalKeep()
workspace()->focusToNull(); // get rid of input focus, bug #317484
}
updateHiddenPreview();
workspace()->windowHidden(this);
}
/**