WABA: Fixes BR6808 and BR7983.

#6808: selecting a "Decoration" by right-clicking on a window de-iconify windows.
#7983: SHIP STOPPER: kwin - titlebars get <2> after the name of the application when changing decorations
Reviewed by gis.

svn path=/trunk/kdebase/kwin/; revision=63563
This commit is contained in:
Waldo Bastian 2000-09-11 18:59:26 +00:00
parent 493fd295b0
commit 1add59200c
3 changed files with 38 additions and 17 deletions

View file

@ -476,7 +476,7 @@ Client::~Client()
Manages the clients. This means handling the very first maprequest:
reparenting, initial geometry, initial state, placement, etc.
*/
bool Client::manage( bool isMapped, bool doNotShow )
bool Client::manage( bool isMapped, bool doNotShow, bool isInitial )
{
if (layout())
@ -551,17 +551,20 @@ bool Client::manage( bool isMapped, bool doNotShow )
}
// initial state
int state = NormalState;
if ( session ) {
if ( session->iconified )
state = IconicState;
} else {
// find out the initial state. Several possibilities exist
XWMHints * hints = XGetWMHints(qt_xdisplay(), win );
if (hints && (hints->flags & StateHint))
state = hints->initial_state;
if (hints)
XFree(hints);
int init_state = NormalState;
if ( isInitial)
{
if ( session ) {
if ( session->iconified )
init_state = IconicState;
} else {
// find out the initial state. Several possibilities exist
XWMHints * hints = XGetWMHints(qt_xdisplay(), win );
if (hints && (hints->flags & StateHint))
init_state = hints->initial_state;
if (hints)
XFree(hints);
}
}
// initial desktop placement - note we don't clobber desk if it is
@ -591,10 +594,12 @@ bool Client::manage( bool isMapped, bool doNotShow )
info->setDesktop( desk );
if (isInitial)
{
setMappingState( init_state );
}
setMappingState( state );
bool showMe = state == NormalState && isOnDesktop( workspace()->currentDesktop() );
bool showMe = (state == NormalState) && isOnDesktop( workspace()->currentDesktop() );
if ( workspace()->isNotManaged( caption() ) )
doNotShow = TRUE;
@ -2561,6 +2566,16 @@ void Client::autoRaise()
autoRaiseTimer = 0;
}
void Client::cloneMode(Client *client)
{
shaded = client->shaded;
geom_restore = client->geom_restore;
max_mode = client->max_mode;
// cmap = client->cmap;
state = client->state;
setCaption(client->caption());
}
NoBorderClient::NoBorderClient( Workspace *ws, WId w, QWidget *parent, const char *name )
: Client( ws, w, parent, name )

View file

@ -74,7 +74,7 @@ public:
virtual bool windowEvent( XEvent * );
bool manage( bool isMapped = FALSE, bool doNotShow = FALSE );
bool manage( bool isMapped = FALSE, bool doNotShow = FALSE, bool isInitial = TRUE );
void setMappingState( int s );
int mappingState() const;
@ -166,6 +166,11 @@ public:
Colormap colormap() const;
/**
* Clone settings from other client.
*/
void cloneMode(Client *);
public slots:
void iconify();
void closeWindow();

View file

@ -2631,8 +2631,9 @@ void Workspace::slotResetAllClients()
(*jt) = newClient;
jt = focus_chain.find (oldClient);
(*jt) = newClient;
newClient->cloneMode(oldClient);
delete oldClient;
bool showIt = newClient->manage( TRUE, TRUE );
bool showIt = newClient->manage( TRUE, TRUE, FALSE );
if ( prev ) {
Window stack[2];
stack[0] = prev->winId();;