From 5abccbec7d182016d99b19c7d531780fd43e4353 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Thu, 15 Jan 2015 16:23:29 +0100 Subject: [PATCH] Split Client::readTransient into two parts --- client.h | 2 ++ group.cpp | 14 ++++++++++++-- manage.cpp | 3 ++- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/client.h b/client.h index 5bb90d4c1c..a66a013579 100644 --- a/client.h +++ b/client.h @@ -942,6 +942,8 @@ private: */ int quick_tile_mode; + Xcb::TransientFor fetchTransient() const; + void readTransientProperty(Xcb::TransientFor &transientFor); void readTransient(); xcb_window_t verifyTransientFor(xcb_window_t transient_for, bool set); void addTransient(Client* cl); diff --git a/group.cpp b/group.cpp index 40dc712ea9..0be70f69c5 100644 --- a/group.cpp +++ b/group.cpp @@ -550,10 +550,14 @@ bool Client::sameAppWindowRoleMatch(const Client* c1, const Client* c2, bool act - every window in the group : group()->members() */ -void Client::readTransient() +Xcb::TransientFor Client::fetchTransient() const +{ + return Xcb::TransientFor(window()); +} + +void Client::readTransientProperty(Xcb::TransientFor &transientFor) { TRANSIENCY_CHECK(this); - Xcb::TransientFor transientFor(window()); xcb_window_t new_transient_for_id = XCB_WINDOW_NONE; if (transientFor.getTransientFor(&new_transient_for_id)) { m_originalTransientForId = new_transient_for_id; @@ -565,6 +569,12 @@ void Client::readTransient() setTransient(new_transient_for_id); } +void Client::readTransient() +{ + Xcb::TransientFor transientFor = fetchTransient(); + readTransientProperty(transientFor); +} + void Client::setTransient(xcb_window_t new_transient_for_id) { TRANSIENCY_CHECK(this); diff --git a/manage.cpp b/manage.cpp index 5470ba0426..a7da4029bc 100644 --- a/manage.cpp +++ b/manage.cpp @@ -103,6 +103,7 @@ bool Client::manage(xcb_window_t w, bool isMapped) auto showOnScreenEdgeCookie = fetchShowOnScreenEdge(); auto colorSchemeCookie = fetchColorScheme(); auto firstInTabBoxCookie = fetchFirstInTabBox(); + auto transientCookie = fetchTransient(); info = new WinInfo(this, m_client, rootWindow(), properties, properties2); // If it's already mapped, ignore hint @@ -134,7 +135,7 @@ bool Client::manage(xcb_window_t w, bool isMapped) updateAllowedActions(); // Group affects isMinimizable() modal = (info->state() & NET::Modal) != 0; // Needs to be valid before handling groups - readTransient(); + readTransientProperty(transientCookie); getIcons(); getWmNormalHints(); // Get xSizeHint getMotifHints();