diff --git a/applets/notifications/package/contents/ui/global/Globals.qml b/applets/notifications/package/contents/ui/global/Globals.qml --- a/applets/notifications/package/contents/ui/global/Globals.qml +++ b/applets/notifications/package/contents/ui/global/Globals.qml @@ -235,11 +235,13 @@ for (var i = 0; i < popupInstantiator.count; ++i) { var popup = popupInstantiator.objectAt(i); + // Popup width is fixed, so don't rely on the actual window size + var popupEffectiveWidth = popupWidth + popup.margins.left + popup.margins.right; if (popupLocation & Qt.AlignHCenter) { - popup.x = x + (screenRect.width - popup.width) / 2; + popup.x = x + (screenRect.width - popupEffectiveWidth) / 2; } else if (popupLocation & Qt.AlignRight) { - popup.x = x + screenRect.width - popupEdgeDistance - popup.width; + popup.x = x + screenRect.width - popupEdgeDistance - popupEffectiveWidth; } else { popup.x = x; } @@ -395,8 +397,8 @@ onResumeJobClicked: popupNotificationsModel.resumeJob(popupNotificationsModel.index(index, 0)) onKillJobClicked: popupNotificationsModel.killJob(popupNotificationsModel.index(index, 0)) + // popup width is fixed onHeightChanged: Qt.callLater(positionPopups) - onWidthChanged: Qt.callLater(positionPopups) Component.onCompleted: { // Register apps that were seen spawning a popup so they can be configured later @@ -411,9 +413,8 @@ } } onObjectAdded: { - // also needed for it to correctly layout its contents + positionPopups(); object.visible = true; - Qt.callLater(positionPopups); } onObjectRemoved: { var notificationId = object.notificationId