New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
KF5 / Plasma 5 desktop Linux tray icon #2934
Comments
By 'not aligned' are you referring to the icon creating a 'box' and pushing the text down? |
Just look at the image, I think it's clear. |
Not necessarily, that is why I asked the question. What you call alignment, others may know as something else.
So 3.2.0 precisely then?
It IS for testing purposes I run 3.2.0 on Linux Mint 16 and notifications for me appear in the top right of my screen as a single line in a box with 'rounded' corners, not over the system tray. |
In both bubbles I see that the icon is in the top-left corner. The only difference is that qbt's bubble has a space where the "title" is on the other bubble. Is that what you are worried about? |
Yes, the space. |
Hmm, that's not a notification. That's a tooltip. Look at |
One more thing. If you see the first screenshot the upload/download icons are not displayed. I can't make it work properly. This is my try but some html tags and css styles don't work. QString html = "qBittorrent<br />";
html += "<nobr> <img src=\":/icons/skin/download.png\"/> <font size=\"1\">";
html += tr("DL speed: %1", "e.g: Download speed: 10 KiB/s").arg(misc::friendlyUnit(QBtSession::instance()->getPayloadDownloadRate(), true));
html += "</font> <img src=\":/icons/skin/seeding.png\"/> <font size=\"1\">";
html += tr("UP speed: %1", "e.g: Upload speed: 10 KiB/s").arg(misc::friendlyUnit(QBtSession::instance()->getPayloadUploadRate(), true));
html += "</font> </nobr>"; @evsh Can you confirm this bug? Related: http://blog.martin-graesslin.com/blog/2014/06/where-are-my-systray-icons/ |
The way to 'fix' this in a web browser environment would be to give the floated element, which I am assuming that < nobr > does, a fixed width so the 'box' does not occupy the full width of the parent element, which is what appears to be happening. |
Alternatively, remove the < nobr > completely and allow the inline < img /> element to behave as it should according to the HTML specifications. |
I tried what you say but the problem is that the div tags and CSS styles are not working. It is not a major problem but I want to see if there is someone else with the same problem. |
Can you open a bug with KDE and ask if this is broken or if they document what HTML/CSS subset they support in their tooltips? |
@FuturePilot Can you report? |
download/upload icons doesn't display because Plasma 5 uses DBus-based StatusNotifierItems instead of XEmbed tray icons. |
This bug affects qbittorrent 3.3.16 running with kde plasma 5.11 on Arch linux. |
#6698 should solve this. |
This bug persists in qbittorrent 4.0.2 running on KDE Plasma 5.11.4. |
More than 3 years later and this bug persists... Arch Linux |
To resolve that, qBt has to implement the StatusNotifierItem specification and preferably unbundle its icons from resources to make them accessible by the tray host application (plasmashell). Qt itself does not provide an API for these DBus abstractions, but it would be a piece of cake to make the proper status tooltip using the KNotifications framework (including a fallback to QSystemTrayIcon when StatusNotifierItem is unavailable. Additionally, to show icons in the tooltip (these up and down arrows, which are currently not rendered because the tray host can not access icons inside the qBt resources), and to render arrows from the system icon theme ("cloud-download" and "cloud-upload"), we need a way to find the path to the system icon theme and its elements. Again, KF5 framework KiconThemes can do that while bare Qt can't. However, the maintainer wants no optional dependencies on platform-specific libraries. Copying significant amount of code from those KF5 frameworks (and, of course, maintaining that code inside of the qBt codebase) does not seem to be a way to go either. I see no way out of this dead end. P.S. The KNotifications framework would also allow to put the qBt notifications into the system KCM module and set their properties there. |
@equeim wrote basically the same 3 years ago. Nothing has changed. |
@zeule, there is no need to use KDE Frameworks for this. Qt supports StatusNotifierItem natively through QSystemTrayIcon. That's how tray icon shown in Plasma, MATE and other DEs that support StatusNotifierItem. The problem is that SNI specification doesn't require system tray implementation to support HTML parsing and AFAIK QSystemTrayIcon doesn't provide any info if tray icon is drawn by app itself (e.g. on Windows or X11 via XEmbed) or by the system (e.g. SNI). The correct solution will be using plain text instead of HTML in tray icon. |
@equeim. here are two screenshots: https://www.freedesktop.org/wiki/Specifications/StatusNotifierItem/Markup/ lists supported HTML tags. I can't see how one can format tooltip contents to follow the format of org.freedesktop.StatusNotifierItem.ToolTip (title and the descriptive text). Sure, we can omit all the icons and formatting and display a plain text as on Windows. It's fun, however, to note that adding KStatusNotifierItem I found that the changes are almost identical to those made for MacOS by d25467d. Makes me wonder again why is Linux desktop not considered as a platform (thus requiring its own platform-specific dependencies)? |
@zeule Oh, I somehow missed HTML markup in specification. Still, qBittorrent uses tags that aren't in spec, and images should be on disk. AFAIK there is no way to separate description from title with QSystemTrayIcon, it puts everything in title. But I don't think that this is a big issue. Using KNotifications will make things more complicated since you will need to detect is system supports SNI and fallback to QSystemTrayIcon if it isn't. |
@equeim, as far as I understand, fallback(s) are already implemented in KNotifications. For example, fallback to QSystemTrayIcon is at the end of this function |
You are right, it didn't say anything anout it in documentation so I didn't check the source code. But I still think that title/description issue is not worth adding 5 additional dependencies (KNotifications depends on 4 another KF5 libraries from Tier 1). |
What about description plus configurable notifications with actions? |
Well, it would be not just fixing tray icon, it will be adding a new feature. It's up to qBittorrent developers to decide whether they need that feature or not (especially given that this feature will be Linux/Unix only and will cost some time to implement and maintain). |
Is there any solution in sight? My system log is being hijacked for a long time now. This is a serious bug :-/ This is just 0.001% of my system log. Everything is drowned, the log is now almost useless:
|
Any updates ? |
I came across this issue today and discovered a quick workaround (not sure if it only applies to me though): If the log continues to show up every few seconds, move your mouse over some other tray icon and wait for the tooltip to show up, then move your mouse away but be careful not to touch the qB icon. This way, those logs related to qB will stop. A quick guess: It seems that Plasma does not correctly recycle the tooltip object, and it keeps refreshing in the background even if the tooltip is no longer visible on the screen. |
also have |
Is this still an issue? |
I'm unable to reproduce with qBittorrent 4.4.1 on Arch Linux running KDE Plasma 5.24.3. |
Seems it's no longer an issue here with 4.4.0 and Plasma 4.24.3. |
It's fixed in the latest release. |
The icon in the notification area popup is not aligned. The problem is present with Qt4 & Qt5. I have tested #2717 but is not solving this issue.
The text was updated successfully, but these errors were encountered: