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;
|
transient_for = None;
|
||||||
is_shape = FALSE;
|
is_shape = FALSE;
|
||||||
is_sticky = FALSE;
|
is_sticky = FALSE;
|
||||||
|
may_move = TRUE;
|
||||||
|
|
||||||
getWMHints();
|
getWMHints();
|
||||||
getWindowProtocols();
|
getWindowProtocols();
|
||||||
|
@ -991,6 +992,8 @@ void Client::mouseMoveEvent( QMouseEvent * e)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( !mayMove()) return;
|
||||||
|
|
||||||
if ( !moveResizeMode )
|
if ( !moveResizeMode )
|
||||||
{
|
{
|
||||||
QPoint p( e->pos() - moveOffset );
|
QPoint p( e->pos() - moveOffset );
|
||||||
|
@ -1725,6 +1728,8 @@ bool Client::performMouseCommand( Options::MouseCommand command, QPoint globalPo
|
||||||
replay = TRUE;
|
replay = TRUE;
|
||||||
break;
|
break;
|
||||||
case Options::MouseMove:
|
case Options::MouseMove:
|
||||||
|
if (!mayMove())
|
||||||
|
break;
|
||||||
mode = Center;
|
mode = Center;
|
||||||
moveResizeMode = TRUE;
|
moveResizeMode = TRUE;
|
||||||
buttonDown = TRUE;
|
buttonDown = TRUE;
|
||||||
|
@ -1736,6 +1741,8 @@ bool Client::performMouseCommand( Options::MouseCommand command, QPoint globalPo
|
||||||
XGrabServer( qt_xdisplay() );
|
XGrabServer( qt_xdisplay() );
|
||||||
break;
|
break;
|
||||||
case Options::MouseResize:
|
case Options::MouseResize:
|
||||||
|
if (!mayMove())
|
||||||
|
break;
|
||||||
moveResizeMode = TRUE;
|
moveResizeMode = TRUE;
|
||||||
buttonDown = TRUE;
|
buttonDown = TRUE;
|
||||||
moveOffset = mapFromGlobal( globalPos );
|
moveOffset = mapFromGlobal( globalPos );
|
||||||
|
|
4
client.h
4
client.h
|
@ -111,6 +111,9 @@ public:
|
||||||
bool isSticky() const;
|
bool isSticky() const;
|
||||||
void setSticky( bool );
|
void setSticky( bool );
|
||||||
|
|
||||||
|
bool mayMove() const { return may_move; }
|
||||||
|
void setMayMove( bool m) { may_move = m; }
|
||||||
|
|
||||||
void takeFocus();
|
void takeFocus();
|
||||||
|
|
||||||
void setMask( const QRegion & );
|
void setMask( const QRegion & );
|
||||||
|
@ -222,6 +225,7 @@ private:
|
||||||
WId transient_for;
|
WId transient_for;
|
||||||
bool is_sticky;
|
bool is_sticky;
|
||||||
bool is_shape;
|
bool is_shape;
|
||||||
|
bool may_move;
|
||||||
void getWMHints();
|
void getWMHints();
|
||||||
void getWindowProtocols();
|
void getWindowProtocols();
|
||||||
uint Pdeletewindow :1; // does the window understand the DeleteWindow protocol?
|
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 );
|
XLowerWindow( qt_xdisplay(), w );
|
||||||
Client * c = new NoBorderClient( ws, w);
|
Client * c = new NoBorderClient( ws, w);
|
||||||
c->setSticky( TRUE );
|
c->setSticky( TRUE );
|
||||||
|
c->setMayMove( FALSE );
|
||||||
ws->setDesktopClient( c );
|
ws->setDesktopClient( c );
|
||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
if ( s == "Kicker" ) {
|
if ( s == "Kicker" ) {
|
||||||
Client * c = new NoBorderClient( ws, w);
|
Client * c = new NoBorderClient( ws, w);
|
||||||
c->setSticky( TRUE );
|
c->setSticky( TRUE );
|
||||||
|
c->setMayMove( FALSE );
|
||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
if ( s == "MAC MENU [menu]" ) {
|
if ( s == "MAC MENU [menu]" ) {
|
||||||
Client * c = new NoBorderClient( ws, w);
|
Client * c = new NoBorderClient( ws, w);
|
||||||
c->setSticky( TRUE );
|
c->setSticky( TRUE );
|
||||||
|
c->setMayMove( FALSE );
|
||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
if ( ( s.right(6) == "[menu]" ) || ( s.right(7) == "[tools]" ) ) {
|
if ( ( s.right(6) == "[menu]" ) || ( s.right(7) == "[tools]" ) ) {
|
||||||
|
@ -1296,21 +1299,16 @@ void Workspace::deskCleanup(CleanupType ct)
|
||||||
{
|
{
|
||||||
QValueList<Client *>::Iterator it(clients.fromLast());
|
QValueList<Client *>::Iterator it(clients.fromLast());
|
||||||
for (; it != clients.begin(); --it) {
|
for (; it != clients.begin(); --it) {
|
||||||
QString s = KWM::title( (*it)->window() );
|
|
||||||
if (s == "Kicker" ||
|
|
||||||
s == "THE DESKTOP")
|
|
||||||
continue;
|
|
||||||
if((!(*it)->isOnDesktop(currentDesktop())) ||
|
if((!(*it)->isOnDesktop(currentDesktop())) ||
|
||||||
((*it)->isIconified()) ||
|
((*it)->isIconified()) ||
|
||||||
((*it)->isSticky()) )
|
((*it)->isSticky()) ||
|
||||||
|
(!(*it)->mayMove()) )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
else {
|
if (ct == Cascade)
|
||||||
if (ct == Cascade)
|
cascadePlacement(*it);
|
||||||
cascadePlacement(*it);
|
else if (ct == Unclutter)
|
||||||
else if (ct == Unclutter)
|
smartPlacement(*it);
|
||||||
smartPlacement(*it);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue