From 25d8cad6f8598f83a8b964dc3eaffb2259f1e55e Mon Sep 17 00:00:00 2001 From: Matthias Ettrich Date: Mon, 22 Nov 1999 18:34:46 +0000 Subject: [PATCH] added sticky to the menu svn path=/trunk/kdebase/kwin/; revision=34729 --- workspace.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/workspace.cpp b/workspace.cpp index 327fbde2c3..398ae3dd23 100644 --- a/workspace.cpp +++ b/workspace.cpp @@ -1489,10 +1489,13 @@ void Workspace::desktopPopupAboutToShow() if ( !desk_popup ) return; desk_popup->clear(); + desk_popup->insertItem( i18n("&All desktops"), 0 ); + if ( popup_client->isSticky() ) + desk_popup->setItemChecked( 0, TRUE ); int id; for ( int i = 1; i <= numberOfDesktops(); i++ ) { id = desk_popup->insertItem( QString("&")+QString::number(i ), i ); - if ( popup_client && popup_client->desktop() == i ) + if ( popup_client && !popup_client->isSticky() && popup_client->desktop() == i ) desk_popup->setItemChecked( id, TRUE ); } } @@ -1509,6 +1512,14 @@ void Workspace::sendToDesktop( int desk ) { if ( !popup_client ) return; + if ( desk == 0 ) { + popup_client->setSticky( !popup_client->isSticky() ); + return; + } + + if ( popup_client->isSticky() ) + popup_client->setSticky( FALSE ); + if ( popup_client->isOnDesktop( desk ) ) return;