Summary:
Qt labels support a HTML subset, using a completely internal parser in
QTextDocument.
The Notification spec support an even smaller subset of notification
elements.
It's important to strip out irrelevant tags that could potentially load
remote information without user interaction, such as img
src or even <b style="background:url...
But we want to maintain the basic rich text formatting of bold and
italics and links.
This parser iterates reads the XML, copying only permissable tags and
attributes.
A future obvious improvement would be to merge the original regular
expressions into this stream parser, but I'm trying to minimise
breakages to get this into 5.12.
Test Plan:
Moved code into it's own class for easy unit testing
Tried a bunch of things, including what the old regexes were doing
Also ran notify send with a few options to make sure things worked
Reviewers: #plasma, fvogt
Reviewed By: fvogt
Subscribers: aacid, fvogt, plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D10188
Summary:
Don't go through the workaround introduced for X11 that makes it go mental.
BUG: 385693
Test Plan: Have been a happy krunner user since
Reviewers: #plasma, davidedmundson
Reviewed By: #plasma, davidedmundson
Subscribers: ngraham, davidedmundson, plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D10197
BUG: 385097
This revision further improves the quality of images in notifications
that was addressed in revision D9993. When I first looked into this, I
tried setting ScaleType on the PreviewJob but it had no effect. I found
that the preview images were being scaled to the small vertical size
that was requested, and this resulted in my first revision. I should
have tried setting ScaleType in addition.
Notification with unpatched libnotificationshelperplugin.so
{F5677396}
Notification with patch applied
{F5677397}
Test Plan:
Take screenshot with Spectacle with unpatched
libnotificationshelperplugin.so installed and observe the blurry
preview image in the notification.
Install the patched libnotificationshelperplugin.so and restart
plasmashell.
Take another screenshot with Spectacle and observe the much improved
quality of the preview image in the notification.
Reviewers: #plasma_workspaces, #plasma, broulik, ngraham
Subscribers: #plasma, #plasma_workspaces, plasma-devel, broulik, ngraham
Tags: #plasma, #spectacle
Differential Revision: https://phabricator.kde.org/D10146
Summary:
To test if the panel is under the cursor we used:
if (geometry().contains(QCursor::pos(screenToFollow()))) {
Unsurprisingly in wayland we don't know the cursor position once it's
left our window. Behaviour seems to be undefined.
We were already using enter and leave events to start the autohide
timer, so we may as well rely on that for tracking state too.
BUG: 377838
Test Plan:
Tested mouse in, mouse out
Tested mouse in and waiting and panel stayed open
Tested opening wifi applet and closing it
That will trigger the restoreAutoHide method as an applet status changed
The panel stayed open because the mouse was on it.
Reviewers: #plasma, mart
Reviewed By: #plasma, mart
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D10101
Summary:
BUG: 385097
FIXED-IN: 5.12.0
This patch to plasma-workspace is to improve the quality of images in notifications as reported in [[ https://bugs.kde.org/show_bug.cgi?id=385097 | Bug 385097 ]].
It is still not perfect because KIO::PreviewJob is used to create the thumbnail, and it only produces two sizes, 128px and 256px, so it is likely that a small image will be scaled up, blurring it somewhat.
I took two screenshots of the same Dolphin window. Here is the before, without the patch:
{F5665511}
And the after, with the patch:
{F5665513}
Better, but still not perfect.
Test Plan: Take screenshots with Spectacle with and without the patched libnotificationshelperplugin library and observe the image quality in the notification. plasmashell must be restarted when the library file is changed for it to take effect.
Reviewers: #plasma_workspaces, #plasma, broulik
Reviewed By: #plasma_workspaces, #plasma, broulik
Subscribers: broulik, ngraham, plasma-devel, #plasma_workspaces, #plasma
Tags: #spectacle, #plasma
Differential Revision: https://phabricator.kde.org/D9993
Plasma's Label has a default height based on the contentHeight of the text.
However, this interferes with QtQuick Layout's logic and might cause an infinite loop.
This can easily be triggered by sending a notification with a multi-line heading/summary.
CHANGELOG: Fixed a freeze caused by certain notifications
BUG: 381154
FIXED-IN: 5.12.0
(cherry picked from commit a3c0565ace)
Plasma's Label has a default height based on the contentHeight of the text.
However, this interferes with QtQuick Layout's logic and might cause an infinite loop.
This can easily be triggered by sending a notification with a multi-line heading/summary.
CHANGELOG: Fixed a freeze caused by certain notifications
BUG: 381154
FIXED-IN: 5.12.0
Notification uses Repeaters for everything. While this is acceptable for jobs and notifications, of which there are few,
the history can turn into a very long list of items. Using a ListView solves memory consumption by creating delegates only as needed.
Since regular notifications and notification history are quite entangled with each other, I had to configure the ListView
from within the Notifications loader. To keep code changes as little as possible, the rest of the UI is just moved into
the ListView header item.
While this is quite an invasive patch for a feature frozen version it's the least invasive approach I could find and is quite
an important memory leak fix for an LTS.
BUG: 389132
FIXED-IN: 5.12.0
CHANGELOG: Fixed memory leak when there are a lot of items in notification history
Differential Revision: https://phabricator.kde.org/D9978
(cherry picked from commit e8f76cc538)
You cannot have a history of notifications if you don't get any notifications in the first place.
Also move checkbox below notification history as it's semantically related.
Differential Revision: https://phabricator.kde.org/D9979
(cherry picked from commit c81a0151f5)
This avoids fading the image source, or the fill mode, or the source size on startup while we're still setting things up.
While a Timer is usually a bad idea, this simplifies the code a lot.
Differential Revision: https://phabricator.kde.org/D9762
We call updateMenu() to cache the first level of menus in advance in global menu applet.
Just move the "opened" call there to ensure it's always called both when the menu shows or when someone manually triggers it.
Differential Revision: https://phabricator.kde.org/D9782
This fixes opening panel controller while an applet config dialog was open.
It would find that we want to show config for a panel but find a config is already open, so it would just close it,
even though it was not the panel controller (which should be toggleable) but another applet config.
While at it restructure if statements a bit.
Differential Revision: https://phabricator.kde.org/D9799
The delete button changes the currentIndex to something else when deleting the current image but that didn't update cfg_Image.
Just listen to when we become current. Might also fix keyboard navigation (didn't test if that worked before but it certainly does now).
BUG: 388805
Differential Revision: https://phabricator.kde.org/D9818
Qt's Drag attached property doesn't like it at all when it gets deleted during drag. (QTBUG-65701)
Even though we try very hard to keep the popup open, when you have multiple notification applets, their dialogs don't know each
other but access a shared data engine.
This means that, since there can only we one hovered dialog at a time, another notification applet might still dismiss the
notification and have our dialog close.
By using a singleton NotificationHelper we 1.) decouple the Drag from the item and 2.) share the "is dragging" state between applets.
BUG: 388684
FIXED-IN: 5.12.0
Differential Revision: https://phabricator.kde.org/D9754
Copy-paste error from plasma-pa, there's no "padding" property as I didn't make it a dedicated component.
Fixed the enormous menu icon I had on the button
Wait for m_ready until doing anything. This keeps the slideshow from first showing the default wallpaper,
then a random slideshow image, and then fade to the next slideshow image.
Differential Revision: https://phabricator.kde.org/D9763
Instead of always sending auto location updates through our daemon query
the current running and mode states of KWin and only send it when running
is true and mode is zero, i.e. automatic location and time updates.
This is primarily meant as an improvement for deployments in sensitive
operation areas, where connections to external sources (even like in our
case anonymously via mozilla location service or if available gps) might
be unwanted.
Another future improvement might be to only launch the daemon on demand,
i.e. let KWin ask for this via dbus through KDED's functionality when
automatic mode is activated (either at startup or per config change).
Reviewers: #plasma, mart
Reviewed By: #plasma, mart
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D9352