From af0dffd89bde034e903360f4dc3d2c024e6cbcd9 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Tue, 13 Jan 2015 13:18:00 +0100 Subject: [PATCH] don't forward events if not visible anymore BUG:342444 Change-Id: I58bfd951e4f55d07c8f3327881354a678a7f65ba --- src/plasmaquick/dialog.cpp | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/src/plasmaquick/dialog.cpp b/src/plasmaquick/dialog.cpp index 74c68a6ec..8c38f474f 100644 --- a/src/plasmaquick/dialog.cpp +++ b/src/plasmaquick/dialog.cpp @@ -1051,7 +1051,9 @@ bool Dialog::event(QEvent *event) d->positionAdjustedForMainItem(me->windowPos()) + position(), me->button(), me->buttons(), me->modifiers()); - QCoreApplication::sendEvent(this, &me2); + if (isVisible()) { + QCoreApplication::sendEvent(this, &me2); + } return true; } break; @@ -1066,7 +1068,9 @@ bool Dialog::event(QEvent *event) we->pixelDelta(), we->angleDelta(), we->delta(), we->orientation(), we->buttons(), we->modifiers(), we->phase()); - QCoreApplication::sendEvent(this, &we2); + if (isVisible()) { + QCoreApplication::sendEvent(this, &we2); + } return true; } break; @@ -1078,7 +1082,9 @@ bool Dialog::event(QEvent *event) QDragEnterEvent de2(d->positionAdjustedForMainItem(de->pos()).toPoint(), de->possibleActions(), de->mimeData(), de->mouseButtons(), de->keyboardModifiers()); - QCoreApplication::sendEvent(this, &de2); + if (isVisible()) { + QCoreApplication::sendEvent(this, &de2); + } return true; } break; @@ -1092,7 +1098,9 @@ bool Dialog::event(QEvent *event) QDragMoveEvent de2(d->positionAdjustedForMainItem(de->pos()).toPoint(), de->possibleActions(), de->mimeData(), de->mouseButtons(), de->keyboardModifiers()); - QCoreApplication::sendEvent(this, &de2); + if (isVisible()) { + QCoreApplication::sendEvent(this, &de2); + } return true; } break; @@ -1103,7 +1111,9 @@ bool Dialog::event(QEvent *event) QDropEvent de2(d->positionAdjustedForMainItem(de->pos()).toPoint(), de->possibleActions(), de->mimeData(), de->mouseButtons(), de->keyboardModifiers()); - QCoreApplication::sendEvent(this, &de2); + if (isVisible()) { + QCoreApplication::sendEvent(this, &de2); + } return true; } break;