For some reason I have not yet fully identified, the notification popup
can get its y coord reset to 0 on resizing. This is a workaround but
fixes an annoying problem.
Now with the geometry being correct right after the popup is
being displayed, it can be placed directly to its exact intended
position (compared to sliding from default position because the
geometry was not known).
This should fix any issues left with the popups flying across
the screen and removes tons of code as a bonus.
REVIEW: 126668
This patch does this:
* moves the screen handling code from the import into
the applet baseclass, which can access the containment
available screen rect and watch for screen changes
* fixes the applet config dialog's custom screen position
setting which has a bug of always being enabled
* consolidates duplicated code in the helper import
into functions
* ensures that popups have correct positions when on
screen that does not start with y=0 (and x=0 in some
cases too)
REVIEW: 126408
CCBUG: 353966
CCBUG: 356461
This slot gets triggered also on popup hiding, which is unwanted.
Should also prevent a crash when unloading notifications applet while
there is an active popup on screen.
BUG: 356402
FIXED-IN: 5.5.1
The notifications popup positioning recently regressed
by some other changes (looks like Qt) and the popups
would fly across the screen.
The proper solution is using KWin effect but given how
close the release is, this needs to be dealt with in a
different way.
The main problem is calculating the initial popup size
because as long as the Dialog is invisible, it has an
incorrect geometry, so it needs to be positioned right
after it's being displayed. The Dialog however gets the
sizes even later, so the code now calls a slot from Dialog
that ensures the sizes are correct before the initial
placement on screen. It's not ideal but I'm out of ideas
otherwise. Plus it should be only temporary until the
KWin effect will replace it.
Besides that, it moves the custom position handling from the
QML into the C++ applet class, making it easier.
REVIEW: 126221
BUG: 355069
FIXED-IN: 5.5.0
It can happen that a notification is placed in the show queue and then
it's closed (eg. programatically) before it was even shown. In this case
the notification must be cleared from the show queue otherwise it will
get displayed and hidden but the popup is never freed for reuse,
resulting in notificaions starting at higher position from the panel.
BUG: 342605
It can happen that a notification is placed in the show queue and then
it's closed (eg. programatically) before it was even shown. In this case
the notification must be cleared from the show queue otherwise it will
get displayed and hidden but the popup is never freed for reuse,
resulting in notificaions starting at higher position from the panel.
BUG: 342605
There were situations when the same notification popup could be be
inserted twice into the available popups list, breaking the positioning
as it would create more notifications than it was able to but they would
never get closed and would offset the whole stack.
One of such scenarios was when user manually closed the popup with the
close button. After it was hidden, the hiding timer still went on to
fire and close it again, causing the above.
Should be all fixed now.
BUG: 342605
When a job finishes, it has an Open button. But we need to check if we
actually have a valid URL first. QUrl::fromUserInput().isValid() seems
like a perfect fit, but as it's not available in QML, I've added it as a
singleton to the notifications helper.
Reviewed-by: Kai Uwe Broulik
This prevents some apps to spam lots of notifications when all it needs
is actually just one single notification.
Imagine you're switching songs in your playlist quickly and each song
change sends new notification, but when you get to the tenth song, you
still see the notification from the 3rd song (because timeouts) and you
don't really care about all those songs changes still in the queue as
you see it in the playlist anyway.
So this patch limits certain apps to have only one single notification
which is always updated. So far Clementine and Spotify is there.
Switching songs or changing playback status creates only one single
popup.
Additionally, the list gets added entries from a config file too.
REVIEW: 118796
Up to this patch there was a new Dialog created for each and every new
notification incoming. After the notification was timed out, it would
close and delete the Dialog, but somehow that didn't free all the memory
and over time plasma-shell could get huuuge mem usage.
Now the notifications reuse only 3 Dialogs the whole lifetime --> memory
does not skyrockets anymore.
Note that the original leak in Dialog might still be present, but
notifications do not expose it anymore.
BUG: 333029
REVIEW: 117903
This is the beginning of revision history for this module. If you
want to look at revision history older than this, please refer to the
techbase wiki for how to use Git history grafting. At the time of
writing, this wiki is located here:
http://community.kde.org/Frameworks/GitOldHistory
If you have already performed the grafting and you don't see any
history beyond this commit, try running "git log" with the "--follow"
argument.
Branched from the monolithic repo kde-workspace, frameworks branch, at commit
049113e719dd2fc4446d054fa1a3aada330094f0