Double-click to close is back.

svn path=/trunk/kdebase/kwin/; revision=174417
This commit is contained in:
Luboš Luňák 2002-08-29 08:59:31 +00:00
parent 3b57952b03
commit f374dba2f2

View file

@ -757,10 +757,22 @@ void GalliumClient::calcHiddenButtons()
void GalliumClient::menuButtonPressed() void GalliumClient::menuButtonPressed()
{ {
QPoint menupoint ( button[BtnMenu]->rect().bottomLeft().x()-3, static QTime* t = NULL;
button[BtnMenu]->rect().bottomLeft().y()+2 ); static GalliumClient* lastClient = NULL;
workspace()->showWindowMenu( button[BtnMenu]->mapToGlobal( menupoint ), this ); if( t == NULL )
button[BtnMenu]->setDown(false); t = new QTime;
bool dbl = ( lastClient == this && t->elapsed() <= QApplication::doubleClickInterval());
lastClient = this;
t->start();
if( !dbl )
{
QPoint menupoint ( button[BtnMenu]->rect().bottomLeft().x()-3,
button[BtnMenu]->rect().bottomLeft().y()+2 );
workspace()->showWindowMenu( button[BtnMenu]->mapToGlobal( menupoint ), this );
button[BtnMenu]->setDown(false);
}
else
closeWindow();
} }
}; };