From cc6886d7dd91ab7a4206ae6637886d7664127bb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20L=C3=BCbking?= Date: Mon, 31 Aug 2015 22:25:48 +0200 Subject: [PATCH] fetch motif hints when get them for managed client notably *after* storing the old values. Otherwise the old value is polluted because of m_hints being nullptr, thus a default value is returned (instead of the actual old value) BUG: 347818 FIXED-IN: 5.4.2 REVIEW: 125007 --- client.cpp | 2 ++ events.cpp | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/client.cpp b/client.cpp index d1725b7612..f325699c55 100644 --- a/client.cpp +++ b/client.cpp @@ -1710,6 +1710,8 @@ void Client::getMotifHints() { const bool wasClosable = m_motif.close(); const bool wasNoBorder = m_motif.noBorder(); + if (m_managed) // only on property change, initial read is prefetched + m_motif.fetch(); m_motif.read(); if (m_motif.hasDecoration() && m_motif.noBorder() != wasNoBorder) { // If we just got a hint telling us to hide decorations, we do so. diff --git a/events.cpp b/events.cpp index 5baab1fb1a..70dd572715 100644 --- a/events.cpp +++ b/events.cpp @@ -909,7 +909,6 @@ void Client::propertyNotifyEvent(xcb_property_notify_event_t *e) break; default: if (e->atom == atoms->motif_wm_hints) { - m_motif.fetch(); getMotifHints(); } else if (e->atom == atoms->net_wm_sync_request_counter) getSyncCounter();