From bc43be9c005c90cd98464d202e9c0c58cf3a37cb Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Tue, 30 May 2023 12:52:16 +0300 Subject: [PATCH] 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. --- src/x11window.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/x11window.cpp b/src/x11window.cpp index 5c3d4fb697..f0f3c83caf 100644 --- a/src/x11window.cpp +++ b/src/x11window.cpp @@ -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); } /**