From f643b71902750600d726aaee7c1e38a8e7ddc373 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Thu, 15 Jan 2015 10:02:42 +0100 Subject: [PATCH] Use NET::WM2InitialMappingState instead of XWMHints One roundtrip to X Server during Client::manage removed. REVIEW: 122068 --- manage.cpp | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/manage.cpp b/manage.cpp index c8ae366f38..5f3337914f 100644 --- a/manage.cpp +++ b/manage.cpp @@ -71,15 +71,6 @@ bool Client::manage(xcb_window_t w, bool isMapped) // SELI TODO: Order all these things in some sane manner - bool init_minimize = false; - XWMHints* hints = XGetWMHints(display(), w); - if (hints && (hints->flags & StateHint) && hints->initial_state == IconicState) - init_minimize = true; - if (hints) - XFree(hints); - if (isMapped) - init_minimize = false; // If it's already mapped, ignore hint - const NET::Properties properties = NET::WMDesktop | NET::WMState | @@ -103,10 +94,14 @@ bool Client::manage(xcb_window_t w, bool isMapped) NET::WM2GroupLeader | NET::WM2Urgency | NET::WM2Input | - NET::WM2Protocols; + NET::WM2Protocols | + NET::WM2InitialMappingState; info = new WinInfo(this, m_client, rootWindow(), properties, properties2); + // If it's already mapped, ignore hint + bool init_minimize = !isMapped && (info->initialMappingState() == NET::Iconic); + m_colormap = attr->colormap; getResourceClass();