Commit 1e175254 authored by Daniel Vrátil's avatar Daniel Vrátil 🤖

[Notifications] Take the screen geometry into account when positioning popup notifications

The availableScreenRect is relative to the current screen, so if the notification
applet is not on the top-left screen, the notification popup will not appear next
to where the applet is but on the top-left screen instead. Adding the absolute
screen geometry to the availableScreenRect ensures that the popup is positioned
on the right screen.

Test Plan:
Position two screens above each other, place the panel on the bottom screen, the
notification now correctly appears on the bottom screen next to the applet.

Reviewers: broulik, davidedmundson, lbeltrame

Reviewed By: broulik, davidedmundson, lbeltrame

Subscribers: lbeltrame, plasma-devel

Tags: #plasma

Differential Revision:
parent b220dcbb
......@@ -134,7 +134,10 @@ QtObject {
// How much vertical screen real estate the notification popups may consume
readonly property real popupMaximumScreenFill: 0.75
property var screenRect: plasmoid ? plasmoid.availableScreenRect : undefined
property var screenRect: plasmoid ? Qt.rect(plasmoid.screenGeometry.x + plasmoid.availableScreenRect.x,
plasmoid.screenGeometry.y + plasmoid.availableScreenRect.y,
plasmoid.availableScreenRect.height) : undefined
onPopupLocationChanged: Qt.callLater(positionPopups)
onScreenRectChanged: Qt.callLater(positionPopups)
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