Also check for SharedEngineView

With the move to a shared QML engine infrastructure, the check for whether the
focus item is a View no longer held and thus Plasma dialogs stayed opened when
clicking the Desktop to dismiss them.

CHANGELOG: Dialogs like Kickoff now properly close when clicking the Desktop
BUG: 349172
REVIEW: 124260
FIXED-IN: 5.13
This commit is contained in:
Kai Uwe Broulik 2015-07-05 15:21:04 +02:00
parent 5cd125eb24
commit 5cf9c04ff5

View File

@ -35,6 +35,8 @@
#include <kwindowsystem.h>
#include <KWindowSystem/KWindowInfo>
#include <kquickaddons/quickviewsharedengine.h>
#include <kwindoweffects.h>
#include <Plasma/Plasma>
#include <Plasma/Corona>
@ -1038,7 +1040,9 @@ void Dialog::focusOutEvent(QFocusEvent *ev)
const QWindow *focusWindow = QGuiApplication::focusWindow();
bool childHasFocus = focusWindow && ((focusWindow->isActive() && isAncestorOf(focusWindow)) || focusWindow->type() & Qt::Popup);
if (qobject_cast<const View *>(focusWindow) || (!parentHasFocus && !childHasFocus)) {
const bool viewClicked = qobject_cast<const KQuickAddons::QuickViewSharedEngine *>(focusWindow) || qobject_cast<const View *>(focusWindow);
if (viewClicked || (!parentHasFocus && !childHasFocus)) {
setVisible(false);
emit windowDeactivated();
}