Revert "give contextmenuevent a chance to run"
ooops. that patch relies on 4.6, didn't mean to commit it yet svn path=/trunk/KDE/kdelibs/; revision=1018488
This commit is contained in:
parent
0afd8efd8c
commit
bf8eb6de86
@ -519,31 +519,10 @@ void Containment::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
|
|||||||
void Containment::mousePressEvent(QGraphicsSceneMouseEvent *event)
|
void Containment::mousePressEvent(QGraphicsSceneMouseEvent *event)
|
||||||
{
|
{
|
||||||
event->ignore();
|
event->ignore();
|
||||||
kDebug();
|
|
||||||
if (d->appletAt(event->scenePos())) {
|
if (d->appletAt(event->scenePos())) {
|
||||||
return; //no unexpected click-throughs
|
return; //no unexpected click-throughs
|
||||||
}
|
}
|
||||||
|
|
||||||
QGraphicsItem *item = scene()->itemAt(event->scenePos());
|
|
||||||
if (event->button() == Qt::RightButton && item != this) {
|
|
||||||
//fake a contextmenuevent in case something in the containment plugin is expecting it
|
|
||||||
QGraphicsSceneContextMenuEvent contextEvent;
|
|
||||||
contextEvent.setReason(QGraphicsSceneContextMenuEvent::Mouse);
|
|
||||||
contextEvent.setPos(event->pos());
|
|
||||||
contextEvent.setScenePos(event->scenePos());
|
|
||||||
contextEvent.setScreenPos(event->screenPos());
|
|
||||||
contextEvent.setModifiers(event->modifiers());
|
|
||||||
contextEvent.setWidget(event->widget());
|
|
||||||
|
|
||||||
scene()->sendEvent(item, contextEvent);
|
|
||||||
if (contextEvent.isAccepted()) {
|
|
||||||
kDebug() << "context-accepted";
|
|
||||||
event->accept();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
kDebug() << "context not accepted";
|
|
||||||
}
|
|
||||||
|
|
||||||
if (d->wallpaper && d->wallpaper->isInitialized() && !event->isAccepted()) {
|
if (d->wallpaper && d->wallpaper->isInitialized() && !event->isAccepted()) {
|
||||||
d->wallpaper->mousePressEvent(event);
|
d->wallpaper->mousePressEvent(event);
|
||||||
}
|
}
|
||||||
@ -599,13 +578,12 @@ void Containment::showDropZone(const QPoint pos)
|
|||||||
|
|
||||||
void Containment::showContextMenu(const QPointF &containmentPos, const QPoint &screenPos)
|
void Containment::showContextMenu(const QPointF &containmentPos, const QPoint &screenPos)
|
||||||
{
|
{
|
||||||
kDebug();
|
|
||||||
d->showContextMenu(mapToScene(containmentPos), screenPos, false, false);
|
d->showContextMenu(mapToScene(containmentPos), screenPos, false, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Containment::contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
|
void Containment::contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
|
||||||
{
|
{
|
||||||
kDebug() << "let's see if we manage to get a context menu here, huh";
|
//kDebug() << "let's see if we manage to get a context menu here, huh";
|
||||||
if (!isContainment() || !scene() || !KAuthorized::authorizeKAction("desktop_contextmenu")) {
|
if (!isContainment() || !scene() || !KAuthorized::authorizeKAction("desktop_contextmenu")) {
|
||||||
Applet::contextMenuEvent(event);
|
Applet::contextMenuEvent(event);
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user