Created attachment 125672 [details] Patch Tooltip position doesn't consider screen's position when it's going over the edge of the second screen. Figuring out how to use phabricator for a simple task like this seemed quite complicated so I'll just add the patch as an attachment.
Comment on attachment 125672 [details] Patch diff --git a/src/radialMap/widgetEvents.cpp b/src/radialMap/widgetEvents.cpp index e2c7a6c..d7178b2 100644 --- a/src/radialMap/widgetEvents.cpp +++ b/src/radialMap/widgetEvents.cpp @@ -160,10 +160,10 @@ void RadialMap::Widget::mouseMoveEvent(QMouseEvent *e) // Same content as before if (m_focus == oldFocus) { if (tooltipRect.right() > screenRect.right()) { - tooltipPosition.setX(screenRect.width() - m_tooltip.width()); + tooltipPosition.setX(screenRect.x() + screenRect.width() - m_tooltip.width()); } if (tooltipRect.bottom() > screenRect.bottom()) { - tooltipPosition.setY(screenRect.height() - m_tooltip.height()); + tooltipPosition.setY(screenRect.y() + screenRect.height() - m_tooltip.height()); } m_tooltip.move(tooltipPosition); return; @@ -235,10 +235,10 @@ void RadialMap::Widget::mouseMoveEvent(QMouseEvent *e) // Make sure we're visible on screen tooltipRect.setSize(QSize(tooltipWidth, tooltipHeight)); if (tooltipRect.right() > screenRect.right()) { - tooltipPosition.setX(screenRect.width() - m_tooltip.width()); + tooltipPosition.setX(screenRect.x() + screenRect.width() - m_tooltip.width()); } if (tooltipRect.bottom() > screenRect.bottom()) { - tooltipPosition.setY(screenRect.height() - m_tooltip.height()); + tooltipPosition.setY(screenRect.y() + screenRect.height() - m_tooltip.height()); } m_tooltip.move(tooltipPosition);
Thought I'd edit the attachment as a normal patch file without commit messages, seems like it didn't go as I planned, my bad.
Many thanks for the patch, can you please submit it to https://invent.kde.org/utilities/filelight/-/merge_requests so it can be reviewed, thanks.
https://invent.kde.org/utilities/filelight/-/merge_requests/9
Git commit 70795c19dbd1aae5cde3ce7fc870ad8ca4de8ac3 by Harald Sitter, on behalf of Teemu Patana. Committed on 05/01/2021 at 10:38. Pushed by sitter into branch 'master'. Fix tooltip positioning in RadialMap The tooltip position was incorrect when shown on the edge of second screen. M +4 -4 src/radialMap/widgetEvents.cpp https://invent.kde.org/utilities/filelight/commit/70795c19dbd1aae5cde3ce7fc870ad8ca4de8ac3
Since there are no screenshots of the problem, I don't know exactly what this does. I think I have noted unexpected tooltop behavior in other KDE applications as well, though. Basically when the tooltip is near the screen edge (the one where two screens meet), it will be displayed on the other screen instead of the current screen the application is on. So it might be worth to look whether other applications require similar fixes (or whether it is possible to unify their behavior somehow).