From c38c2147b2a728eeaae2ad7cfc3a97ccc1496ca8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubo=C5=A1=20Lu=C5=88=C3=A1k?= Date: Thu, 28 Jul 2005 16:23:20 +0000 Subject: [PATCH] Better way of implementing the last commit. svn path=/trunk/KDE/kdebase/kwin/; revision=439672 --- activation.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/activation.cpp b/activation.cpp index 6c9c143635..f119977af0 100644 --- a/activation.cpp +++ b/activation.cpp @@ -848,8 +848,14 @@ void Client::startupIdChanged() bool asn_valid = workspace()->checkStartupNotification( window(), asn_id, asn_data ); if( !asn_valid ) return; - if( asn_data.desktop() != 0 && !isOnAllDesktops()) - workspace()->sendClientToDesktop( this, asn_data.desktop(), true ); + // If the ASN contains desktop, move it to the desktop, otherwise move it to the current + // desktop (since the new ASN should make the window act like if it's a new application + // launched). However don't affect the window's desktop if it's set to be on all desktops. + int desktop = workspace()->currentDesktop(); + if( asn_data.desktop() != 0 ) + desktop = asn_data.desktop(); + if( !isOnAllDesktops()) + workspace()->sendClientToDesktop( this, desktop, true ); Time timestamp = asn_id.timestamp(); if( timestamp == 0 && asn_data.timestamp() != -1U ) timestamp = asn_data.timestamp();