https://bugs.kde.org/show_bug.cgi?id=521477
Bug ID: 521477
Summary: kclockd tooltip (hover text) not working in xfce
systray
Classification: Applications
Product: KClock
Version First 26.04.1
Reported In:
Platform: openSUSE
OS: Linux
Status: REPORTED
Severity: normal
Priority: NOR
Component: General
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected]
Target Milestone: ---
DESCRIPTION
kclockd uses <html> element in StatusNotifierItem ToolTip which is not in spec
(https://www.freedesktop.org/wiki/Specifications/StatusNotifierItem/Markup/)
and confuses xfce systray (when hover on clock you get empty tooltip or
neighbour icon tooltip)
STEPS TO REPRODUCE
1. open kclock
2. add alarm in future
3. close kclock
4. kill kclockd process
5. run `dbus-monitor --session --pcap > /tmp/a.pcap` in terminal
6. run `kclockd` in another terminal
7. exit dbus-monitor using ctrl+c
8. open /tmp/a.pcap with wireshark
9. search `frame contains "Alarm:"` in wireshark
10. I hope you find only 1item, click it
11. scroll down in wireshark hex viewer
OBSERVED RESULT
<html>Alarm: <b>Monday 8:08 PM</b></html>
EXPECTED RESULT
Alarm: <b>Monday 8:08 PM</b>
SOFTWARE/OS VERSIONS
Operating System: openSUSE Tumbleweed 20260612
KDE Plasma Version: 6.7.80
KDE Frameworks Version: 6.28.0
Qt Version: 6.11.1
ADDITIONAL INFORMATION
you can fix kclockd by making it detect and remove `<html>` … `</html>`:
diff --git a/src/kclockd/alarmmodel.cpp b/src/kclockd/alarmmodel.cpp
index 22c6ff0e..cab3182e 100644
--- a/src/kclockd/alarmmodel.cpp
+++ b/src/kclockd/alarmmodel.cpp
@@ -248,8 +248,18 @@ void AlarmModel::updateNotifierItem(quint64 time)
m_item->setStatus(KStatusNotifierItem::Active);
+ QString tooltip = xi18nc("@info",
+ "Alarm: <shortcut>%1 %2</shortcut>",
+
QLocale::system().standaloneDayName(dateTime.date().dayOfWeek()),
+ QLocale::system().toString(dateTime.time(),
QLocale::ShortFormat));
+ using namespace Qt::StringLiterals;
+ if (tooltip.startsWith("<html>"_L1) && tooltip.endsWith("</html>"_L1))
{
+ enum {
+ prefix_size = sizeof "<html>" - 1,
+ suffix_size = sizeof "</html>" - 1,
+ surround_size = prefix_size + suffix_size
+ };
+ tooltip.slice(prefix_size, tooltip.size() - surround_size);
+ }
m_item->setToolTip(QStringLiteral("clock"),
QStringLiteral("KClock"),
- xi18nc("@info",
- "Alarm: <shortcut>%1 %2</shortcut>",
-
QLocale::system().standaloneDayName(dateTime.date().dayOfWeek()),
- QLocale::system().toString(dateTime.time(),
QLocale::ShortFormat)));
+ tooltip);
}
or somehow make xi18nc not surround contents with `<html>` … `</html>`
--
You are receiving this mail because:
You are watching all bug changes.