highly improved style switching

svn path=/trunk/kdebase/kwin/; revision=56978
This commit is contained in:
Matthias Ettrich 2000-07-15 00:46:38 +00:00
parent e316ecc005
commit bda93628e4
3 changed files with 56 additions and 24 deletions

View file

@ -480,7 +480,7 @@ Client::~Client()
Manages the clients. This means handling the very first maprequest:
reparenting, initial geometry, initial state, placement, etc.
*/
void Client::manage( bool isMapped )
bool Client::manage( bool isMapped, bool isReset )
{
if (layout())
@ -567,13 +567,20 @@ void Client::manage( bool isMapped )
setMappingState( state );
if ( state == NormalState && isOnDesktop( workspace()->currentDesktop() ) ) {
bool showMe = state == NormalState && isOnDesktop( workspace()->currentDesktop() );
if ( showMe && !isReset ) {
Events::raise( isTransient() ? Events::TransNew : Events::New );
if ( isMapped ) {
show();
} else {
workspace()->raiseClient( this ); // ensure constrains
show();
if ( options->focusPolicyIsReasonable() && wantsTabFocus() )
workspace()->requestFocus( this );
}
}
// other settings from the previous session
if ( session ) {
@ -582,7 +589,10 @@ void Client::manage( bool isMapped )
delete session;
if ( !isReset )
workspace()->updateClientArea();
return showMe;
}

View file

@ -74,7 +74,7 @@ public:
virtual bool windowEvent( XEvent * );
void manage( bool isMapped = FALSE );
bool manage( bool isMapped = FALSE, bool isReset = FALSE );
void setMappingState( int s );
int mappingState() const;

View file

@ -1559,6 +1559,7 @@ void Workspace::raiseClient( Client* c )
if ( !c )
return;
qDebug("raise client %s", c->caption().latin1() );
if ( tab_box->isVisible() )
return;
@ -2499,21 +2500,42 @@ bool Workspace::keyPressMouseEmulation( XKeyEvent key )
*/
void Workspace::slotResetAllClients()
{
for (ClientList::Iterator it = clients.begin(); it != clients.end(); ++it) {
ClientList stack = stacking_order;
Client* active = activeClient();
block_focus = TRUE;
Client* prev = 0;
for (ClientList::Iterator it = stack.fromLast(); it != stack.end(); --it) {
Client *oldClient = (*it);
WId w = oldClient->window();
oldClient->hide();
WId w = oldClient->window();
XUnmapWindow( qt_xdisplay(), w );
oldClient->releaseWindow();
// Replace oldClient with newClient in all lists
Client *newClient = clientFactory (w);
(*it) = newClient;
ClientList::Iterator jt = stacking_order.find (oldClient);
if ( oldClient == active )
active = newClient;
ClientList::Iterator jt = clients.find (oldClient);
(*jt) = newClient;
jt = stacking_order.find (oldClient);
(*jt) = newClient;
jt = focus_chain.find (oldClient);
(*jt) = newClient;
delete oldClient;
newClient->manage( TRUE );
bool showIt = newClient->manage( TRUE, TRUE );
if ( prev ) {
Window stack[2];
stack[0] = prev->winId();;
stack[1] = newClient->winId();
XRestackWindows( qt_xdisplay(), stack, 2 );
}
if ( showIt )
newClient->show();
prev = newClient;
}
block_focus = FALSE;
if ( active )
requestFocus( active );
}
/*!