From fa32b0f2b6914ee5b77dff48989ba15c3f1e71be Mon Sep 17 00:00:00 2001 From: "Aaron J. Seigo" Date: Fri, 5 Sep 2008 20:37:15 +0000 Subject: [PATCH] be a little more forgiving in trying to find the Best View svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=857615 --- applet.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/applet.cpp b/applet.cpp index 12d25c03f..ef072bf3d 100644 --- a/applet.cpp +++ b/applet.cpp @@ -440,15 +440,18 @@ QGraphicsView *Applet::view() const } QGraphicsView *found = 0; + QGraphicsView *possibleFind = 0; foreach (QGraphicsView *view, scene()->views()) { if (view->sceneRect().intersects(sceneBoundingRect()) || view->sceneRect().contains(scenePos())) { - if (!found || view->isActiveWindow()) { + if (view->isActiveWindow()) { found = view; + } else { + possibleFind = view; } } } - return found; + return found ? found : possibleFind; } QRectF Applet::mapFromView(const QGraphicsView *view, const QRect &rect) const