[Notifications] Don't allow popup to obscure things in corners

Authored by ngraham on Aug 19 2019, 3:32 AM.



One thing that has been bugging me a bit with notifications is how close the pop-up is
to the screen corners/edges. It's so close that it obscures various things that live very
close to screen edges, such as windows' titlebars and the text input field in chat apps.
The latter case is really annoying in particular because if you have multiple chat apps
running, notifications from the app that's in the background will obscure what you're
typing in the text input field of the foreground chat app.

This patch fixes these types of issues by doing the following:

  • Adjusting the popup positioning algorithm make popups that are in a corner equidistant from both adjacent screen edges, rather than only one
  • Doubling the defualt distance from the nearest corner/edge

The combination of these changes allows pop-ups to no longer obscure window titlebars
and chat windows' input fields.

BUG: 401500
FIXED-IN: 5.17.0

Test Plan

Top corner popup position no longer obscures window titlebar text and buttons:

Bottom corner popup position no longer obscures chat app's text input field:

Diff Detail

R120 Plasma Workspace
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.
ngraham created this revision.Aug 19 2019, 3:32 AM
Restricted Application added a project: Plasma. · View Herald TranscriptAug 19 2019, 3:32 AM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
ngraham requested review of this revision.Aug 19 2019, 3:32 AM
ngraham updated this revision to Diff 64012.Aug 19 2019, 3:35 AM

Revert unnecessary variable name change

cblack added a subscriber: cblack.Aug 19 2019, 3:36 AM

Not a fan.


What's this for?

Not a fan.

I'm open to suggestions regarding how to solve the issue mentioned in the Summary section as well as reported by a user in https://bugs.kde.org/show_bug.cgi?id=401500. I do think it's a real issue though. I find myself periodically irritated by it.


Without this, popupEdgeDistance only moves popups that are in a screen corner away from one of the adjacent edges, rather than both.

broulik accepted this revision.Aug 29 2019, 3:35 PM

master only, please

This revision is now accepted and ready to land.Aug 29 2019, 3:35 PM
This revision was automatically updated to reflect the committed changes.
ngraham edited the summary of this revision. (Show Details)Aug 29 2019, 3:40 PM