Use the new showWindowMenu() variant.

svn path=/trunk/kdebase/kwin/; revision=317634
This commit is contained in:
Luciano Montanaro 2004-06-04 13:09:47 +00:00
parent 0d986b6d48
commit 3989a49457
2 changed files with 20 additions and 13 deletions

View file

@ -1316,12 +1316,15 @@ void KeramikClient::desktopChange()
void KeramikClient::menuButtonPressed()
{
QPoint menuPoint ( button[MenuButton]->rect().bottomLeft().x() - 6,
button[MenuButton]->rect().bottomLeft().y() + 3 );
KDecorationFactory* f = factory();
showWindowMenu( button[MenuButton]->mapToGlobal( menuPoint ));
if( !f->exists( this )) // 'this' was destroyed
return;
QPoint menuTop ( button[MenuButton]->rect().topLeft() );
QPoint menuBottom ( button[MenuButton]->rect().bottomRight() );
menuTop += QPoint(-6, -3);
menuBottom += QPoint(6, 3);
KDecorationFactory* f = factory();
showWindowMenu( QRect( button[MenuButton]->mapToGlobal( menuTop ),
button[MenuButton]->mapToGlobal( menuBottom )) );
if( !f->exists( this )) // 'this' was destroyed
return;
button[MenuButton]->setDown(false);
}

View file

@ -973,13 +973,17 @@ void QuartzClient::calcHiddenButtons()
// Make sure the menu button follows double click conventions set in kcontrol
void QuartzClient::menuButtonPressed()
{
QPoint menupoint ( button[BtnMenu]->rect().bottomLeft().x()-1,
button[BtnMenu]->rect().bottomLeft().y()+2 );
menupoint = button[BtnMenu]->mapToGlobal( menupoint );
KDecorationFactory* f = factory();
showWindowMenu(menupoint);
if( !f->exists( this )) // 'this' was destroyed
return;
QRect menuRect = button[BtnMenu]->rect();
QPoint menuTop ( menuRect.topLeft() );
QPoint menuBottom ( menuRect.bottomRight() );
menuTop += QPoint(-1, 2);
menuBottom += QPoint(1, 2);
menuTop = button[BtnMenu]->mapToGlobal( menuTop );
menuBottom = button[BtnMenu]->mapToGlobal( menuBottom );
KDecorationFactory* f = factory();
showWindowMenu(QRect(menuTop, menuBottom));
if( !f->exists( this )) // 'this' was destroyed
return;
button[BtnMenu]->setDown(false);
}