From 436011e0ec92e461b7a9b8571e063b5b1765ed49 Mon Sep 17 00:00:00 2001 From: Ismael Asensio Date: Sat, 4 Sep 2021 14:43:44 +0200 Subject: [PATCH] X11Client: emit isCloseableChanged when updated This allows the decoration buttons to be updated accordingly when the status changes. We also need to explicitely update allowed actions when rules are applied, as `isCloseable` is not a settable property, but an allowed action BUG: 424370 FIXED-IN: 5.22.90 --- src/x11client.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/x11client.cpp b/src/x11client.cpp index 013e5d6de3..c5031b3f1c 100644 --- a/src/x11client.cpp +++ b/src/x11client.cpp @@ -2162,7 +2162,7 @@ void X11Client::setClientShown(bool shown) void X11Client::getMotifHints() { - const bool wasClosable = m_motif.close(); + const bool wasClosable = isCloseable(); const bool wasNoBorder = m_motif.noBorder(); if (m_managed) // only on property change, initial read is prefetched m_motif.fetch(); @@ -2179,7 +2179,7 @@ void X11Client::getMotifHints() // mminimize; - Ignore, bogus - E.g. shading or sending to another desktop is "minimizing" too // mmaximize; - Ignore, bogus - Maximizing is basically just resizing - const bool closabilityChanged = wasClosable != m_motif.close(); + const bool closabilityChanged = wasClosable != isCloseable(); if (isManaged()) updateDecoration(true); // Check if noborder state has changed if (closabilityChanged) { @@ -2396,6 +2396,9 @@ void X11Client::updateAllowedActions(bool force) if ((allowed_actions & NET::ActionMax) != (old_allowed_actions & NET::ActionMax)) { Q_EMIT maximizeableChanged(allowed_actions & NET::ActionMax); } + if ((allowed_actions & NET::ActionClose) != (old_allowed_actions & NET::ActionClose)) { + Q_EMIT closeableChanged(allowed_actions & NET::ActionClose); + } } } @@ -4701,6 +4704,7 @@ bool X11Client::hasStrut() const void X11Client::applyWindowRules() { AbstractClient::applyWindowRules(); + updateAllowedActions(); setBlockingCompositing(info->isBlockingCompositing()); }