From f02955dcbaf4a05f390bd96c037924cdd208fca4 Mon Sep 17 00:00:00 2001 From: Waldo Bastian Date: Wed, 19 Apr 2000 04:36:47 +0000 Subject: [PATCH] WABA: Make desktop, kicker and the macbar unmovable. svn path=/trunk/kdebase/kwin/; revision=47007 --- client.cpp | 7 +++++++ client.h | 4 ++++ workspace.cpp | 20 +++++++++----------- 3 files changed, 20 insertions(+), 11 deletions(-) diff --git a/client.cpp b/client.cpp index 802dfb44f7..94213f93e3 100644 --- a/client.cpp +++ b/client.cpp @@ -348,6 +348,7 @@ Client::Client( Workspace *ws, WId w, QWidget *parent, const char *name, WFlags transient_for = None; is_shape = FALSE; is_sticky = FALSE; + may_move = TRUE; getWMHints(); getWindowProtocols(); @@ -991,6 +992,8 @@ void Client::mouseMoveEvent( QMouseEvent * e) return; } + if ( !mayMove()) return; + if ( !moveResizeMode ) { QPoint p( e->pos() - moveOffset ); @@ -1725,6 +1728,8 @@ bool Client::performMouseCommand( Options::MouseCommand command, QPoint globalPo replay = TRUE; break; case Options::MouseMove: + if (!mayMove()) + break; mode = Center; moveResizeMode = TRUE; buttonDown = TRUE; @@ -1736,6 +1741,8 @@ bool Client::performMouseCommand( Options::MouseCommand command, QPoint globalPo XGrabServer( qt_xdisplay() ); break; case Options::MouseResize: + if (!mayMove()) + break; moveResizeMode = TRUE; buttonDown = TRUE; moveOffset = mapFromGlobal( globalPos ); diff --git a/client.h b/client.h index f4d0e5d818..188bc6a571 100644 --- a/client.h +++ b/client.h @@ -111,6 +111,9 @@ public: bool isSticky() const; void setSticky( bool ); + bool mayMove() const { return may_move; } + void setMayMove( bool m) { may_move = m; } + void takeFocus(); void setMask( const QRegion & ); @@ -222,6 +225,7 @@ private: WId transient_for; bool is_sticky; bool is_shape; + bool may_move; void getWMHints(); void getWindowProtocols(); uint Pdeletewindow :1; // does the window understand the DeleteWindow protocol? diff --git a/workspace.cpp b/workspace.cpp index 7d7eea3452..91640de372 100644 --- a/workspace.cpp +++ b/workspace.cpp @@ -115,17 +115,20 @@ Client* Workspace::clientFactory( Workspace *ws, WId w ) XLowerWindow( qt_xdisplay(), w ); Client * c = new NoBorderClient( ws, w); c->setSticky( TRUE ); + c->setMayMove( FALSE ); ws->setDesktopClient( c ); return c; } if ( s == "Kicker" ) { Client * c = new NoBorderClient( ws, w); c->setSticky( TRUE ); + c->setMayMove( FALSE ); return c; } if ( s == "MAC MENU [menu]" ) { Client * c = new NoBorderClient( ws, w); c->setSticky( TRUE ); + c->setMayMove( FALSE ); return c; } if ( ( s.right(6) == "[menu]" ) || ( s.right(7) == "[tools]" ) ) { @@ -1296,21 +1299,16 @@ void Workspace::deskCleanup(CleanupType ct) { QValueList::Iterator it(clients.fromLast()); for (; it != clients.begin(); --it) { - QString s = KWM::title( (*it)->window() ); - if (s == "Kicker" || - s == "THE DESKTOP") - continue; if((!(*it)->isOnDesktop(currentDesktop())) || ((*it)->isIconified()) || - ((*it)->isSticky()) ) + ((*it)->isSticky()) || + (!(*it)->mayMove()) ) continue; - else { - if (ct == Cascade) - cascadePlacement(*it); - else if (ct == Unclutter) - smartPlacement(*it); - } + if (ct == Cascade) + cascadePlacement(*it); + else if (ct == Unclutter) + smartPlacement(*it); } }