change desktop when messsage boxes pop-up on shutdown
svn path=/trunk/kdebase/kwin/; revision=57399
This commit is contained in:
parent
3b707063bf
commit
1b17660205
1 changed files with 22 additions and 18 deletions
32
client.cpp
32
client.cpp
|
@ -440,6 +440,9 @@ Client::Client( Workspace *ws, WId w, QWidget *parent, const char *name, WFlags
|
|||
if ( mainClient()->isSticky() )
|
||||
setSticky( TRUE );
|
||||
|
||||
// window wants to stay on top?
|
||||
stays_on_top = ( info->state() & NET::StaysOnTop) != 0;
|
||||
|
||||
|
||||
// should we open this window on a certain desktop?
|
||||
if ( info->desktop() == NETWinInfo::OnAllDesktops )
|
||||
|
@ -447,20 +450,6 @@ Client::Client( Workspace *ws, WId w, QWidget *parent, const char *name, WFlags
|
|||
else if ( info->desktop() )
|
||||
desk = info->desktop(); // window had the initial desktop property!
|
||||
|
||||
|
||||
// window wants to stay on top?
|
||||
stays_on_top = ( info->state() & NET::StaysOnTop) != 0;
|
||||
|
||||
|
||||
|
||||
|
||||
// if this window is transient, ensure that it is opened on the
|
||||
// same window as its parent. this is necessary when an application
|
||||
// starts up on a different desktop than is currently displayed
|
||||
//
|
||||
if ( isTransient() )
|
||||
desk = mainClient()->desktop();
|
||||
|
||||
}
|
||||
|
||||
/*!
|
||||
|
@ -559,8 +548,23 @@ bool Client::manage( bool isMapped, bool doNotShow )
|
|||
if ( session ) {
|
||||
desk = session->desktop;
|
||||
} else if ( desk <= 0 ) {
|
||||
// if this window is transient, ensure that it is opened on the
|
||||
// same window as its parent. this is necessary when an application
|
||||
// starts up on a different desktop than is currently displayed
|
||||
//
|
||||
if ( isTransient() )
|
||||
desk = mainClient()->desktop();
|
||||
|
||||
if ( desk <= 0 ) {
|
||||
// assume window wants to be visible on the current desktop
|
||||
desk = workspace()->currentDesktop();
|
||||
} else if ( !isMapped && !doNotShow && desk != workspace()->currentDesktop() ) {
|
||||
//window didn't specify any specific desktop but will appear
|
||||
//somewhere else. This happens for example with "save data?"
|
||||
//dialogs on shutdown. Switch to the respective desktop in
|
||||
//that case.
|
||||
workspace()->setCurrentDesktop( desk );
|
||||
}
|
||||
}
|
||||
|
||||
info->setDesktop( desk );
|
||||
|
|
Loading…
Reference in a new issue