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:
parent
493fd295b0
commit
1add59200c
3 changed files with 38 additions and 17 deletions
29
client.cpp
29
client.cpp
|
@ -476,7 +476,7 @@ Client::~Client()
|
||||||
Manages the clients. This means handling the very first maprequest:
|
Manages the clients. This means handling the very first maprequest:
|
||||||
reparenting, initial geometry, initial state, placement, etc.
|
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())
|
if (layout())
|
||||||
|
@ -551,18 +551,21 @@ bool Client::manage( bool isMapped, bool doNotShow )
|
||||||
}
|
}
|
||||||
|
|
||||||
// initial state
|
// initial state
|
||||||
int state = NormalState;
|
int init_state = NormalState;
|
||||||
|
if ( isInitial)
|
||||||
|
{
|
||||||
if ( session ) {
|
if ( session ) {
|
||||||
if ( session->iconified )
|
if ( session->iconified )
|
||||||
state = IconicState;
|
init_state = IconicState;
|
||||||
} else {
|
} else {
|
||||||
// find out the initial state. Several possibilities exist
|
// find out the initial state. Several possibilities exist
|
||||||
XWMHints * hints = XGetWMHints(qt_xdisplay(), win );
|
XWMHints * hints = XGetWMHints(qt_xdisplay(), win );
|
||||||
if (hints && (hints->flags & StateHint))
|
if (hints && (hints->flags & StateHint))
|
||||||
state = hints->initial_state;
|
init_state = hints->initial_state;
|
||||||
if (hints)
|
if (hints)
|
||||||
XFree(hints);
|
XFree(hints);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// initial desktop placement - note we don't clobber desk if it is
|
// initial desktop placement - note we don't clobber desk if it is
|
||||||
// set to some value, in case the initial desktop code in the
|
// set to some value, in case the initial desktop code in the
|
||||||
|
@ -591,10 +594,12 @@ bool Client::manage( bool isMapped, bool doNotShow )
|
||||||
|
|
||||||
info->setDesktop( desk );
|
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() ) )
|
if ( workspace()->isNotManaged( caption() ) )
|
||||||
doNotShow = TRUE;
|
doNotShow = TRUE;
|
||||||
|
@ -2561,6 +2566,16 @@ void Client::autoRaise()
|
||||||
autoRaiseTimer = 0;
|
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 )
|
NoBorderClient::NoBorderClient( Workspace *ws, WId w, QWidget *parent, const char *name )
|
||||||
: Client( ws, w, parent, name )
|
: Client( ws, w, parent, name )
|
||||||
|
|
7
client.h
7
client.h
|
@ -74,7 +74,7 @@ public:
|
||||||
|
|
||||||
virtual bool windowEvent( XEvent * );
|
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 );
|
void setMappingState( int s );
|
||||||
int mappingState() const;
|
int mappingState() const;
|
||||||
|
@ -166,6 +166,11 @@ public:
|
||||||
|
|
||||||
Colormap colormap() const;
|
Colormap colormap() const;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Clone settings from other client.
|
||||||
|
*/
|
||||||
|
void cloneMode(Client *);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void iconify();
|
void iconify();
|
||||||
void closeWindow();
|
void closeWindow();
|
||||||
|
|
|
@ -2631,8 +2631,9 @@ void Workspace::slotResetAllClients()
|
||||||
(*jt) = newClient;
|
(*jt) = newClient;
|
||||||
jt = focus_chain.find (oldClient);
|
jt = focus_chain.find (oldClient);
|
||||||
(*jt) = newClient;
|
(*jt) = newClient;
|
||||||
|
newClient->cloneMode(oldClient);
|
||||||
delete oldClient;
|
delete oldClient;
|
||||||
bool showIt = newClient->manage( TRUE, TRUE );
|
bool showIt = newClient->manage( TRUE, TRUE, FALSE );
|
||||||
if ( prev ) {
|
if ( prev ) {
|
||||||
Window stack[2];
|
Window stack[2];
|
||||||
stack[0] = prev->winId();;
|
stack[0] = prev->winId();;
|
||||||
|
|
Loading…
Reference in a new issue