Split Client::readTransient into two parts

This commit is contained in:
Martin Gräßlin 2015-01-15 16:23:29 +01:00
parent 584bdbce71
commit 5abccbec7d
3 changed files with 16 additions and 3 deletions

View file

@ -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);

View file

@ -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);

View file

@ -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();