[Notifications] Make popup placement more resilient
ClosedPublic

Authored by broulik on Jun 23 2019, 2:29 PM.

Details

Summary

The popup width is fixed, so don't rely on the actual dialog window width which might be bollocks.
More importantly, place the popups immediately and before they are shown so they show up correctly and don't fly all over the place.
It can happen that the popup contents aren't readily laid out when we enter positionPopups() after object creation, so don't reserve any space for the popup until it

Test Plan

The first popup might still fly in from outside the screen or something but it's a significant improvement on wayland at least. For some more elaborate notifications I now have a slight delay before they show up but that might have been also one of the reasons for them showing up in the wrong place before.

Please try triggering alternate notifications from [1] and notify-send. It's very strange why sometimes you have a delay now but at least stuff doesn't fly all over or cause weird gaps :)

(Don't really know which bugreport on bugzilla is that particular issue, there's some others with notification popups overlapping and appearing in random places but might be unrelated)

[1] https://tests.peter.sh/notification-generator/

Diff Detail

Repository
R120 Plasma Workspace
Lint
Lint Skipped
Unit
Unit Tests Skipped
broulik created this revision.Jun 23 2019, 2:29 PM
Restricted Application added a project: Plasma. · View Herald TranscriptJun 23 2019, 2:29 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
broulik requested review of this revision.Jun 23 2019, 2:29 PM
ngraham accepted this revision.Jun 23 2019, 2:46 PM
ngraham added a subscriber: ngraham.

Works for me.

This revision is now accepted and ready to land.Jun 23 2019, 2:46 PM

Stable branch please

nicolasfella accepted this revision.Jun 23 2019, 3:31 PM
davidedmundson accepted this revision.Jun 23 2019, 3:47 PM
davidedmundson added a subscriber: davidedmundson.

Much better, but it still has one callLater which I don't like.

Time for Dialog2!

broulik updated this revision to Diff 60509.Jun 23 2019, 3:53 PM
broulik edited the summary of this revision. (Show Details)
broulik edited the test plan for this revision. (Show Details)
  • get rid of Qt.callLater
  • Fix (work around) issue when dialog contents arent ready yet
broulik updated this revision to Diff 60510.Jun 23 2019, 3:53 PM
  • Fix typo
ngraham accepted this revision.Jun 23 2019, 3:56 PM
nicolasfella accepted this revision.Jun 23 2019, 4:03 PM
This revision was automatically updated to reflect the committed changes.