From 3989a4945738afe2d35618b60c375d624a2927ff Mon Sep 17 00:00:00 2001 From: Luciano Montanaro Date: Fri, 4 Jun 2004 13:09:47 +0000 Subject: [PATCH] Use the new showWindowMenu() variant. svn path=/trunk/kdebase/kwin/; revision=317634 --- clients/keramik/keramik.cpp | 15 +++++++++------ clients/quartz/quartz.cpp | 18 +++++++++++------- 2 files changed, 20 insertions(+), 13 deletions(-) diff --git a/clients/keramik/keramik.cpp b/clients/keramik/keramik.cpp index e2f279e55d..755b18ac14 100644 --- a/clients/keramik/keramik.cpp +++ b/clients/keramik/keramik.cpp @@ -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); } diff --git a/clients/quartz/quartz.cpp b/clients/quartz/quartz.cpp index de1e39df62..de65b094ce 100644 --- a/clients/quartz/quartz.cpp +++ b/clients/quartz/quartz.cpp @@ -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); }