From 7ca46b1e1caea5eb1295b455a7fa90c511e11b79 Mon Sep 17 00:00:00 2001 From: Matthias Ettrich Date: Sat, 15 Jul 2000 01:12:41 +0000 Subject: [PATCH] do not manage magic for java applets svn path=/trunk/kdebase/kwin/; revision=56985 --- KWinInterface.h | 1 + client.cpp | 17 ++++++++++------- client.h | 2 +- workspace.cpp | 23 +++++++++++++++++++++++ workspace.h | 6 ++++++ 5 files changed, 41 insertions(+), 8 deletions(-) diff --git a/KWinInterface.h b/KWinInterface.h index 006c8995d0..4c7ed6d1c4 100644 --- a/KWinInterface.h +++ b/KWinInterface.h @@ -12,6 +12,7 @@ class KWinInterface : virtual public DCOPObject virtual ASYNC cascadeDesktop() = 0; virtual ASYNC unclutterDesktop() = 0; virtual ASYNC reconfigure() = 0; + virtual void doNotManage(QString)= 0; }; diff --git a/client.cpp b/client.cpp index d5d9afc411..c3f4e1a56c 100644 --- a/client.cpp +++ b/client.cpp @@ -480,7 +480,7 @@ Client::~Client() Manages the clients. This means handling the very first maprequest: reparenting, initial geometry, initial state, placement, etc. */ -bool Client::manage( bool isMapped, bool isReset ) +bool Client::manage( bool isMapped, bool doNotShow ) { if (layout()) @@ -564,13 +564,16 @@ bool Client::manage( bool isMapped, bool isReset ) } info->setDesktop( desk ); - + setMappingState( state ); - + bool showMe = state == NormalState && isOnDesktop( workspace()->currentDesktop() ); - if ( showMe && !isReset ) { + if ( workspace()->isNotManaged( caption() ) ) + doNotShow = TRUE; + + if ( showMe && !doNotShow ) { Events::raise( isTransient() ? Events::TransNew : Events::New ); if ( isMapped ) { show(); @@ -588,10 +591,10 @@ bool Client::manage( bool isMapped, bool isReset ) } delete session; - - if ( !isReset ) + + if ( !doNotShow ) workspace()->updateClientArea(); - + return showMe; } diff --git a/client.h b/client.h index b8451f5a50..ecfe96cc2d 100644 --- a/client.h +++ b/client.h @@ -74,7 +74,7 @@ public: virtual bool windowEvent( XEvent * ); - bool manage( bool isMapped = FALSE, bool isReset = FALSE ); + bool manage( bool isMapped = FALSE, bool doNotShow = FALSE ); void setMappingState( int s ); int mappingState() const; diff --git a/workspace.cpp b/workspace.cpp index 4501a2fbe5..5b611ae4b9 100644 --- a/workspace.cpp +++ b/workspace.cpp @@ -1491,6 +1491,28 @@ void Workspace::reconfigure() } +/*! + avoids managing a window with title \a title + */ +void Workspace::doNotManage( QString title ) +{ + doNotManageList.append( title ); +} + +/*! + Hack for java applets + */ +bool Workspace::isNotManaged( const QString& title ) +{ + for ( QStringList::Iterator it = doNotManageList.begin(); it != doNotManageList.end(); ++it ) { + if ( (*it) == title ) { + doNotManageList.remove( it ); + return TRUE; + } + } + return FALSE; +} + /*! Lowers the client \a c taking stays-on-top flags, layers, transient windows and window groups into account. @@ -2698,4 +2720,5 @@ void Workspace::saveDesktopSettings() } + #include "workspace.moc" diff --git a/workspace.h b/workspace.h index 82cc90131c..1de9a8b082 100644 --- a/workspace.h +++ b/workspace.h @@ -174,8 +174,11 @@ public: void cascadeDesktop(); void unclutterDesktop(); void reconfigure(); + void doNotManage(QString); QString desktopName( int desk ); + + bool isNotManaged( const QString& title ); public slots: void setCurrentDesktop( int new_desktop ); @@ -309,6 +312,9 @@ private: QWidget* supportWindow; QRect area; + + // swallowing + QStringList doNotManageList; }; inline WId Workspace::rootWin() const