From 8460a9ad3ebff83cad0555968b949411c9515414 Mon Sep 17 00:00:00 2001 From: Matthias Ettrich Date: Mon, 10 Jan 2000 03:47:30 +0000 Subject: [PATCH] make transients sticky when their main window becomes sticky svn path=/trunk/kdebase/kwin/; revision=37996 --- client.cpp | 1 + workspace.cpp | 12 ++++++++++++ workspace.h | 1 + 3 files changed, 14 insertions(+) diff --git a/client.cpp b/client.cpp index 03647989b2..523b78d914 100644 --- a/client.cpp +++ b/client.cpp @@ -1418,6 +1418,7 @@ void Client::setSticky( bool b ) is_sticky = b; if ( !is_sticky ) setDesktop( workspace()->currentDesktop() ); + workspace()->setStickyTransientsOf( this, b ); stickyChange( is_sticky ); } diff --git a/workspace.cpp b/workspace.cpp index 2b1f08e8ef..3a1cc01ad8 100644 --- a/workspace.cpp +++ b/workspace.cpp @@ -810,6 +810,18 @@ void Workspace::iconifyOrDeiconifyTransientsOf( Client* c ) } + +/*! + Sets the client \a c's transient windows' sticky property to \a sticky. + */ +void Workspace::setStickyTransientsOf( Client* c, bool sticky ) +{ + for ( ClientList::ConstIterator it = clients.begin(); it != clients.end(); ++it) { + if ( (*it)->transientFor() == c->window() && (*it)->isSticky() != sticky ) + (*it)->setSticky( sticky ); + } +} + /*! Returns whether a client with the specified \a caption exists, or not. */ diff --git a/workspace.h b/workspace.h index 4916bf0cde..797311bb80 100644 --- a/workspace.h +++ b/workspace.h @@ -98,6 +98,7 @@ public: bool iconifyMeansWithdraw( Client* ); void iconifyOrDeiconifyTransientsOf( Client* ); + void setStickyTransientsOf( Client*, bool sticky ); bool hasCaption( const QString& caption );