obey more controlcenter options (mouse actions for frame and titlebar)

svn path=/trunk/kdebase/kwin/; revision=62090
This commit is contained in:
Matthias Ettrich 2000-08-28 12:31:16 +00:00
parent cca94688ee
commit 6a54a209af
3 changed files with 34 additions and 42 deletions

View file

@ -1134,43 +1134,36 @@ bool Client::isMaximizable() const
*/
void Client::mousePressEvent( QMouseEvent * e)
{
if (buttonDown) return;
if (e->state() & AltButton)
{
if (buttonDown)
return;
Options::MouseCommand com = Options::MouseNothing;
if (e->state() & AltButton) {
if ( e->button() == LeftButton ) {
com = options->commandAll1();
}
else if (e->button() == MidButton) {
} else if (e->button() == MidButton) {
com = options->commandAll2();
}
else if (e->button() == RightButton) {
} else if (e->button() == RightButton) {
com = options->commandAll3();
}
else {
return;
}
performMouseCommand( com, e->globalPos());
}
else {
if ( e->button() == LeftButton ) {
if ( options->focusPolicyIsReasonable() )
workspace()->requestFocus( this );
workspace()->raiseClient( this );
mouseMoveEvent( e );
buttonDown = TRUE;
moveOffset = e->pos();
invertedMoveOffset = rect().bottomRight() - e->pos();
com = isActive() ? options->commandActiveTitlebar1() : options->commandInactiveTitlebar1();
}
else if ( e->button() == MidButton ) {
workspace()->lowerClient( this );
com = isActive() ? options->commandActiveTitlebar2() : options->commandInactiveTitlebar2();
}
else if ( e->button() == RightButton ) {
if ( isActive() & ( options->focusPolicy != Options::ClickToFocus && options->clickRaise ) )
autoRaise();
workspace()->clientPopup( this )->popup( e->globalPos() );
com = isActive() ? options->commandActiveTitlebar3() : options->commandInactiveTitlebar3();
}
}
performMouseCommand( com, e->globalPos());
}
/*!
@ -1226,8 +1219,7 @@ void Client::mouseMoveEvent( QMouseEvent * e)
if ( !isMovable()) return;
if ( !moveResizeMode )
{
if ( !moveResizeMode ) {
QPoint p( e->pos() - moveOffset );
if (p.manhattanLength() >= 6) {
moveResizeMode = TRUE;
@ -1242,10 +1234,10 @@ void Client::mouseMoveEvent( QMouseEvent * e)
if ( ( isMove() && options->moveMode != Options::Opaque )
|| ( isResize() && options->resizeMode != Options::Opaque ) )
XGrabServer( qt_xdisplay() );
}
else
} else {
return;
}
}
if ( mode != Center && shaded )
giveUpShade();
@ -1845,9 +1837,6 @@ bool Client::isShade() const
void Client::setShade( bool s )
{
if (!isMovable())
return;
if ( shaded == s )
return;
@ -2098,6 +2087,9 @@ bool Client::performMouseCommand( Options::MouseCommand command, QPoint globalPo
workspace()->lowerClient( this );
break;
case Options::MouseOperationsMenu:
if ( isActive() & ( options->focusPolicy != Options::ClickToFocus && options->clickRaise ) )
autoRaise();
workspace()->clientPopup( this )->popup( globalPos );
break;
case Options::MouseToggleRaiseAndLower:
if ( workspace()->topClientOnDesktop() == this )

View file

@ -354,7 +354,7 @@ void B2Titlebar::paintEvent(QPaintEvent * /*e*/)
void B2Titlebar::mouseDoubleClickEvent( QMouseEvent * )
{
client->setShade( !client->isShade() );
client->workspace()->performWindowOperation( client, options->operationTitlebarDblClick() );
client->workspace()->requestFocus( client );
}

View file

@ -510,7 +510,7 @@ void KDEClient::windowWrapperShowEvent( QShowEvent* )
void KDEClient::mouseDoubleClickEvent( QMouseEvent * e )
{
if (titlebar->geometry().contains( e->pos() ) )
setShade( !isShade() );
workspace()->performWindowOperation( this, options->operationTitlebarDblClick() );
workspace()->requestFocus( this );
}