diff --git a/applets/notifications/package/contents/ui/NotificationItem.qml b/applets/notifications/package/contents/ui/NotificationItem.qml --- a/applets/notifications/package/contents/ui/NotificationItem.qml +++ b/applets/notifications/package/contents/ui/NotificationItem.qml @@ -55,6 +55,8 @@ property ListModel actions: ListModel { } + readonly property bool dragging: thumbnailStripLoader.item ? thumbnailStripLoader.item.dragging : false + function pressedAction() { for (var i = 0, count = actionRepeater.count; i < count; ++i) { var item = actionRepeater.itemAt(i) diff --git a/applets/notifications/package/contents/ui/NotificationPopup.qml b/applets/notifications/package/contents/ui/NotificationPopup.qml --- a/applets/notifications/package/contents/ui/NotificationPopup.qml +++ b/applets/notifications/package/contents/ui/NotificationPopup.qml @@ -95,7 +95,7 @@ onContainsMouseChanged: { if (containsMouse) { notificationTimer.stop() - } else if (!containsMouse && visible) { + } else if (!containsMouse && !notificationItem.dragging && visible) { notificationTimer.restart() } } @@ -140,6 +140,14 @@ Qt.openUrlExternally(url) notificationPositioner.closePopup(notificationProperties.source); } + + onDraggingChanged: { + if (dragging) { + notificationTimer.stop(); + } else if (!root.containsMouse && !dragging && root.visible) { + notificationTimer.restart(); + } + } } } diff --git a/applets/notifications/package/contents/ui/ThumbnailStrip.qml b/applets/notifications/package/contents/ui/ThumbnailStrip.qml --- a/applets/notifications/package/contents/ui/ThumbnailStrip.qml +++ b/applets/notifications/package/contents/ui/ThumbnailStrip.qml @@ -43,6 +43,10 @@ // hence it's based on the mainLayout.width instead readonly property int maximumItemCount: Math.floor(mainLayout.width / itemSquareSize) + // whether we're currently dragging, this way we can keep the popup around during the entire + // drag operation even if the mouse leaves the popup + property bool dragging: false + model: { var urls = notificationItem.urls if (urls.length <= maximumItemCount) { @@ -120,6 +124,10 @@ "text/plain": modelData }) + drag.onActiveChanged: { + previewList.dragging = drag.active + } + // first item determins the ListView height Binding { target: previewList