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 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; }
void KWMThemeClient::menuButtonPressed() { mnuBtn->setDown(false); // will stay down if I don't do this QPoint pos = mnuBtn->mapToGlobal(mnuBtn->rect().bottomLeft()); showWindowMenu( pos ); }
void AuroraeClient::menuClicked() { showWindowMenu(QCursor::pos()); }