Commit 684bc806 authored by Kai Uwe Broulik's avatar Kai Uwe Broulik 🍇
Browse files

[Notifications] Also check transient parent for whether it's a dialog

In case a context menu is opened, we want to check the dialog it came from.
This fixes the case of notifications dancing around when opening a context menu in
System Tray but does not fix the case when opening a context menu in the notification
itself since there it cannot know that the still open System Tray popup is the one
we should evade and not the popup with the menu in it.

CCBUG: 426187


(cherry picked from commit bc12c6ca)
parent ae43cd88
...@@ -139,7 +139,16 @@ void NotificationApplet::doDrag(QQuickItem *item, const QUrl &url, const QPixmap ...@@ -139,7 +139,16 @@ void NotificationApplet::doDrag(QQuickItem *item, const QUrl &url, const QPixmap
QWindow *NotificationApplet::focussedPlasmaDialog() const QWindow *NotificationApplet::focussedPlasmaDialog() const
{ {
return qobject_cast<PlasmaQuick::Dialog *>(qApp->focusWindow()); auto *focusWindow = qApp->focusWindow();
if (qobject_cast<PlasmaQuick::Dialog *>(focusWindow)) {
return focusWindow;
}
if (focusWindow) {
return qobject_cast<PlasmaQuick::Dialog *>(focusWindow->transientParent());
}
return nullptr;
} }
QQuickItem *NotificationApplet::systemTrayRepresentation() const QQuickItem *NotificationApplet::systemTrayRepresentation() const
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment