void NextClient::menuButtonPressed() { // Probably don't need this null check, but we might as well. if (button[MENU_IDX]) { QRect menuRect = button[MENU_IDX]->rect(); QPoint menuTop = button[MENU_IDX]->mapToGlobal(menuRect.topLeft()); QPoint menuBottom = button[MENU_IDX]->mapToGlobal(menuRect.bottomRight()); menuTop += QPoint(1, 1); menuBottom += QPoint(1, 1); KDecorationFactory* f = factory(); showWindowMenu(QRect(menuTop, menuBottom)); if( !f->exists( this )) // 'this' was deleted return; button[MENU_IDX]->setDown(false); } }
void KniftyClient::menuButtonPressed() { static QTime* t = NULL; static KniftyClient* lastClient = NULL; if (t == NULL) t = new QTime; bool dbl = (lastClient == this && t->elapsed() <= QApplication::doubleClickInterval()); lastClient = this; t->start(); if( !dbl ) { QPoint pos = m_button[ButtonMenu]->mapToGlobal( m_button[ButtonMenu]->rect().bottomLeft() ); KDecorationFactory* f = factory(); showWindowMenu( pos ); if( !f->exists( this )) // 'this' was deleted return; m_button[ButtonMenu]->setDown(false); } else closing = true; }
void KCommonDecoration::menuButtonPressed() { static QTime* t = NULL; static KCommonDecoration* lastClient = NULL; if (t == NULL) t = new QTime; bool dbl = (lastClient==this && t->elapsed() <= QApplication::doubleClickInterval()); lastClient = this; t->start(); if (!dbl || !decorationBehaviour(DB_MenuClose) ) { QRect menuRect = m_button[MenuButton]->rect(); QPoint menutop = m_button[MenuButton]->mapToGlobal(menuRect.topLeft()); QPoint menubottom = m_button[MenuButton]->mapToGlobal(menuRect.bottomRight())+QPoint(0,2); KDecorationFactory* f = factory(); showWindowMenu(QRect(menutop, menubottom)); if( !f->exists( this )) // 'this' was deleted return; m_button[MenuButton]->setDown(false); } else closing = true; }