diff --git a/client.h b/client.h index d824969996..84584a22f2 100644 --- a/client.h +++ b/client.h @@ -423,6 +423,7 @@ class Client : public QObject, public KDecorationDefines void cleanGrouping(); void checkGroupTransients(); void setTransient( Window new_transient_for_id ); + void checkActiveModal(); Client* transient_for; Window transient_for_id; Window original_transient_for_id; @@ -453,7 +454,6 @@ class Client : public QObject, public KDecorationDefines uint not_obscured : 1; uint urgency : 1; // XWMHints, UrgencyHint uint ignore_focus_stealing : 1; // don't apply focus stealing prevention to this client - uint check_active_modal : 1; // see Client::addTransient() WindowRules client_rules; void getWMHints(); void readIcons(); @@ -492,6 +492,7 @@ class Client : public QObject, public KDecorationDefines bool shade_geometry_change; int border_left, border_right, border_top, border_bottom; QRegion _mask; + static bool check_active_modal; // see Client::checkActiveModal() friend struct FetchNameInternalPredicate; friend struct CheckIgnoreFocusStealingProcedure; friend struct ResetupRulesProcedure; diff --git a/group.cpp b/group.cpp index 91b73d80ba..a01b32de58 100644 --- a/group.cpp +++ b/group.cpp @@ -861,7 +861,15 @@ void Client::checkGroup( Group* set_group, bool force ) } } checkGroupTransients(); - // if the active window got new modal transient, activate it + checkActiveModal(); + workspace()->updateClientLayer( this ); + } + +bool Client::check_active_modal = false; + +void Client::checkActiveModal() + { + // if the active window got new modal transient, activate it. // cannot be done in AddTransient(), because there may temporarily // exist loops, breaking findModal Client* check_modal = workspace()->mostRecentlyActivatedClient(); @@ -869,11 +877,13 @@ void Client::checkGroup( Group* set_group, bool force ) { Client* new_modal = check_modal->findModal(); if( new_modal != NULL && new_modal != check_modal ) + { + if( !new_modal->isManaged()) + return; // postpone check until end of manage() workspace()->activateClient( new_modal ); + } check_modal->check_active_modal = false; } - workspace()->updateClientLayer( this ); } - } // namespace diff --git a/manage.cpp b/manage.cpp index 09fbae7c86..8799b27942 100644 --- a/manage.cpp +++ b/manage.cpp @@ -477,6 +477,8 @@ bool Client::manage( Window w, bool isMapped ) delete session; + checkActiveModal(); + ungrabXServer(); client_rules.discardTemporary();