WABA: Make desktop, kicker and the macbar unmovable.
svn path=/trunk/kdebase/kwin/; revision=47007
This commit is contained in:
parent
830909e544
commit
f02955dcba
3 changed files with 20 additions and 11 deletions
|
@ -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 );
|
||||
|
|
4
client.h
4
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?
|
||||
|
|
|
@ -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,23 +1299,18 @@ void Workspace::deskCleanup(CleanupType ct)
|
|||
{
|
||||
QValueList<Client *>::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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*!
|
||||
Lowers the client \a c taking layers, transient windows and window
|
||||
|
|
Loading…
Reference in a new issue