Don't try to focus new modal for the active window while the new modal

is still in manage(). Should fix first-time showing of kwallet dialog.

svn path=/trunk/kdebase/kwin/; revision=335960
This commit is contained in:
Luboš Luňák 2004-08-04 12:19:50 +00:00
parent a9517d38c2
commit 5ac4a74f2f
3 changed files with 17 additions and 4 deletions

View file

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

View file

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

View file

@ -477,6 +477,8 @@ bool Client::manage( Window w, bool isMapped )
delete session;
checkActiveModal();
ungrabXServer();
client_rules.discardTemporary();