Only keep fullscreen for transients on top - not random group members

BUG: 293265
REVIEW: 103866
This commit is contained in:
Thomas Lübking 2012-02-04 16:45:30 +01:00
parent b052f6429f
commit 2d99ef918b

View file

@ -840,15 +840,37 @@ Layer Client::belongsToLayer() const
return NormalLayer; return NormalLayer;
} }
bool rec_checkTransientOnTop(const ClientList &transients, const Client *topmost)
{
foreach (const Client *transient, transients) {
if (transient == topmost || rec_checkTransientOnTop(transient->transients(), topmost)) {
return true;
}
}
return false;
}
bool Client::isActiveFullScreen() const bool Client::isActiveFullScreen() const
{ {
if (!isFullScreen())
return false;
// const Client* ac = workspace()->mostRecentlyActivatedClient(); // instead of activeClient() - avoids flicker
// if (!ac)
// return false;
// not needed, for xinerama -> && ( ac == this || this->group() == ac->group())
// only raise fullscreen above docks if it's the topmost window in unconstrained stacking order, // only raise fullscreen above docks if it's the topmost window in unconstrained stacking order,
// i.e. the window set to be topmost by the user (also includes transients of the fullscreen window) // i.e. the window set to be topmost by the user (also includes transients of the fullscreen window)
const Client* ac = workspace()->mostRecentlyActivatedClient(); // instead of activeClient() - avoids flicker
const Client* top = workspace()->topClientOnDesktop(workspace()->currentDesktop(), screen(), true, false); const Client* top = workspace()->topClientOnDesktop(workspace()->currentDesktop(), screen(), true, false);
return(isFullScreen() && ac != NULL && top != NULL if (!top)
// not needed, for xinerama && ( ac == this || this->group() == ac->group()) return false;
&& (top == this || this->group() == top->group()));
// check whether we ...
if (top == this)
return true;
// ... or one of our transients is topmost
return rec_checkTransientOnTop(transients_list, top);
} }
} // namespace } // namespace