Bug 487339 - Filelight Tooltip Incorrect Offset when Displayed to the Right of the Mouse Cursor
Summary: Filelight Tooltip Incorrect Offset when Displayed to the Right of the Mouse C...
Status: RESOLVED FIXED
Alias: None
Product: filelight
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Unassigned bugs mailing-list
URL:
Keywords:
: 487470 (view as bug list)
Depends on:
Blocks:
 
Reported: 2024-05-21 19:59 UTC by Eamonn Rea
Modified: 2024-05-29 08:57 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Incorrect Tooltip Behaviour (71.96 KB, image/png)
2024-05-21 19:59 UTC, Eamonn Rea
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Eamonn Rea 2024-05-21 19:59:28 UTC
Created attachment 169689 [details]
Incorrect Tooltip Behaviour

SUMMARY
When the Filelight tooltip displays to the *right* of the mouse cursor (i.e. when it has enough room to display on the right), then it displays very slightly to the right and down of the mouse cursor, like a tooltip with some padding.

But when the Filelight tooltip displays to the *left* of the mouse cursor, it is offset, and the further to the *right* that the mouse cursor goes, the further to the *left* that the tooltip goes. In other words moving the cursor to the right of the window moves the tooltip *further away* from the cursor, and moving it to the right moves the tooltip *closer to* the cursor. As it gets closer it eventually has enough space to display to the right of the cursor again and so fades back to being beside the cursor as described above, and displays normally.

I have attached a screenshot of the offset tooltip.

STEPS TO REPRODUCE
1. Open Filelight
2. Move the cursor far enough to the right of the window so that the tooltip appears on the left of the cursor - The window may need to be reduced in size to make this easier to accomplish 
3. Observe tooltip being on the incorrect side of the window.

OBSERVED RESULT
Tooltip displays away from the mouse when to the left of the cursor.

EXPECTED RESULT
Tooltip behaves the same on the left side of the cursor as it does on the right.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 6.9.1 Linux Zen
KDE Plasma Version: 6.0.4
KDE Frameworks Version: 6.2.0
Qt Version: 6.7.0

ADDITIONAL INFORMATION
I don't remember this happening in Plasma 5.X, but unsure if it affected all versions of Plasma 6.

I took a look at the code but wasn't sure why this was happening, I couldn't find the logic that flips the tooltip.

I looked for other applications I have installed that use Kirigami which have the same dynamic tooltips as Filelight but couldn't find any, I wanted to see if they have the same behaviour and if not what they do on their side to fix the problem. But I came up short.
Comment 1 Harald Sitter 2024-05-24 03:48:09 UTC
Which version of filelight is this?
Comment 2 Eamonn Rea 2024-05-24 22:43:13 UTC
Filelight 24.02.2, the latest version available for my distribution (Arch Linux).

Filelight 24.05 is in the Testing repos currently, so I have not yet had a chance to test it.
Comment 3 Eamonn Rea 2024-05-26 14:50:20 UTC
Updated my system and I now have access to Filelight 24.05.0. The issue persists. I have updated my system information below.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 6.9.2 Linux Zen
KDE Plasma Version: 6.0.5
KDE Frameworks Version: 6.2.0
Qt Version: 6.7.1
Comment 4 Harald Sitter 2024-05-27 11:35:59 UTC
Thanks!
Comment 5 Harald Sitter 2024-05-27 12:04:29 UTC
*** Bug 487470 has been marked as a duplicate of this bug. ***
Comment 6 Bug Janitor Service 2024-05-27 12:55:05 UTC
A possibly relevant merge request was started @ https://invent.kde.org/utilities/filelight/-/merge_requests/128
Comment 7 Harald Sitter 2024-05-29 07:39:29 UTC
Git commit 47eaad0469e2262d10499bde22c6e63992f55f06 by Harald Sitter.
Committed on 29/05/2024 at 07:36.
Pushed by sitter into branch 'master'.

manually position tooltip so it's correct

Qt tries to reposition when there isn't enough space and gloriously
fails. Instead adjust the coordinates such that Qt has no reason to
reposition.

since this adds a lot of code we now have a shared shapetooltip item
that is used by the centershape and the segmentshape. also correctly set
shapeitem as parent for our tooltip (the coordindates are relative to it
because our mouseyarea is on top of shapeitem)

M  +4    -6    src/qml/CenterShape.qml
M  +4    -6    src/qml/SegmentShape.qml
A  +24   -0    src/qml/ShapeToolTip.qml     [License: GPL(3+eV) GPL(v3.0) GPL(v2.0)]
M  +1    -0    src/qml/qml.qrc

https://invent.kde.org/utilities/filelight/-/commit/47eaad0469e2262d10499bde22c6e63992f55f06
Comment 8 Harald Sitter 2024-05-29 08:57:06 UTC
Git commit 062b80adb44f0d1c9dc41dcd3e23a9ccb4a60994 by Harald Sitter.
Committed on 29/05/2024 at 07:43.
Pushed by sitter into branch 'release/24.05'.

manually position tooltip so it's correct

Qt tries to reposition when there isn't enough space and gloriously
fails. Instead adjust the coordinates such that Qt has no reason to
reposition.

since this adds a lot of code we now have a shared shapetooltip item
that is used by the centershape and the segmentshape. also correctly set
shapeitem as parent for our tooltip (the coordindates are relative to it
because our mouseyarea is on top of shapeitem)


(cherry picked from commit 47eaad0469e2262d10499bde22c6e63992f55f06)

M  +4    -6    src/qml/CenterShape.qml
M  +4    -6    src/qml/SegmentShape.qml
A  +24   -0    src/qml/ShapeToolTip.qml     [License: GPL(3+eV) GPL(v3.0) GPL(v2.0)]
M  +1    -0    src/qml/qml.qrc

https://invent.kde.org/utilities/filelight/-/commit/062b80adb44f0d1c9dc41dcd3e23a9ccb4a60994