move context menus on applets according to their popup position when we're a panel containment

svn path=/trunk/KDE/kdelibs/; revision=1123209
This commit is contained in:
Aaron J. Seigo 2010-05-05 15:49:37 +00:00
parent 62f2eb46f1
commit 80bc92740f

View File

@ -613,7 +613,7 @@ void Containment::contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
}
if (d->showContextMenu(event->scenePos(), event->screenPos(), true,
event->reason() == QGraphicsSceneContextMenuEvent::Mouse)) {
event->reason() == QGraphicsSceneContextMenuEvent::Mouse)) {
event->accept();
} else {
Applet::contextMenuEvent(event);
@ -761,7 +761,12 @@ bool ContainmentPrivate::showContextMenu(const QPointF &point, const QPoint &scr
if (!desktopMenu.isEmpty()) {
//kDebug() << "executing at" << screenPos;
desktopMenu.exec(screenPos);
QPoint pos = screenPos;
if (applet && isPanelContainment()) {
desktopMenu.adjustSize();
pos = applet->popupPosition(desktopMenu.size());
}
desktopMenu.exec(pos);
return true;
}