From a6304cef724cebc7b31cbf18eec2cbd5a907d20a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubo=C5=A1=20Lu=C5=88=C3=A1k?= Date: Wed, 23 Oct 2002 15:52:18 +0000 Subject: [PATCH] Fix #30506 by handling the desktop and sticky flag together. The is_sticky flag should go, desk == OnAllDesktops should be the same. svn path=/trunk/kdebase/kwin/; revision=185277 --- client.cpp | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/client.cpp b/client.cpp index 7e0a4e8402..1ef21e5ab5 100644 --- a/client.cpp +++ b/client.cpp @@ -789,11 +789,16 @@ bool Client::manage( bool isMapped, bool doNotShow, bool isInitial ) // initial desktop placement - note we don't clobber desk if it is // set to some value, in case the initial desktop code in the // constructor has already set a value for us + if ( session ) { desk = session->desktop; if ( desk <= 0 ) desk = workspace()->currentDesktop(); - } else if ( desk <= 0 ) { + if( session->sticky ) + setSticky( true ); + else + info->setDesktop( desk ); + } else if ( desk <= 0 && !isSticky()) { // 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 @@ -810,11 +815,16 @@ bool Client::manage( bool isMapped, bool doNotShow, bool isInitial ) //somewhere else. This happens for example with "save data?" //dialogs on shutdown. Switch to the respective desktop in //that case. + // TODO check what is this supposed to do, looks like unnecessary + // focus stealing to me workspace()->setCurrentDesktop( desk ); } - } - - info->setDesktop( desk ); + info->setDesktop( desk ); + } else if( isSticky()) { + info->setDesktop( NETWinInfo::OnAllDesktops ); + } else + info->setDesktop( desk ); + if (isInitial) { setMappingState( init_state ); @@ -825,7 +835,6 @@ bool Client::manage( bool isMapped, bool doNotShow, bool isInitial ) // other settings from the previous session if ( session ) { - setSticky( session->sticky ); setStaysOnTop( session->staysOnTop ); setSkipTaskbar( session->skipTaskbar ); setSkipPager( session->skipPager );