Bug 166734 - Comment text is blurry and background is semi-transparent
Summary: Comment text is blurry and background is semi-transparent
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
25.8.0.0 alpha0+
Hardware: x86-64 (AMD64) All
: medium minor
Assignee: Armin Le Grand (collabora)
URL:
Whiteboard: target:26.2.0 target:25.8.0.2
Keywords: bibisected, bisected, regression
Depends on:
Blocks: Calc-Comments
  Show dependency treegraph
 
Reported: 2025-05-26 14:16 UTC by Buovjaga
Modified: 2025-07-17 10:54 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
sample png (61.28 KB, image/png)
2025-06-09 03:34 UTC, nobu
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Buovjaga 2025-05-26 14:16:41 UTC
1. Open Calc and add a comment
2. Hover over cell with comment

The text is blurry with gtk3 and kf6. Gen and Windows are fine. Also, the comment is now slightly transparent. I think users will find this distracting.

Bibisected with linux-64-25.8 to 256ad05887a23484ef4494cc90ea168696bbba37
NDOO: NotesDisplayOnOverlay

Arch Linux 64-bit
Version: 25.8.0.0.alpha1+ (X86_64) / LibreOffice Community
Build ID: 1f61a2ec4e252d2eeccabd65a10650c8ee231a1b
CPU threads: 8; OS: Linux 6.14; UI render: default; VCL: kf6 (cairo+wayland)
Locale: fi-FI (fi_FI.UTF-8); UI: en-US
Calc: CL threaded
Built on 26 May 2025
Comment 1 nobu 2025-06-09 03:34:47 UTC
Created attachment 201152 [details]
sample png


I use Windows OS.
The text will not be blurred as in the description.
However, the background color becomes semi-transparent, and you can see the text behind it.
There were times when it was almost transparent for a while, but we could not find any reproduction procedure.
There should be a problem on Windows as well.

Version: 25.8.0.0.alpha1+ (X86_64) / LibreOffice Community
Build ID: fef47a8bcc8531e69ccea29f2db5929741e66a3e
CPU threads: 4; OS: Windows 10 X86_64 (build 19045); UI render: Skia/Raster; VCL: win
Locale: ja-JP (ja_JP); UI: ja-JP
Calc: CL threaded
Comment 2 Buovjaga 2025-06-09 04:39:09 UTC
Right, now I notice gen VCL also has the transparency.
Comment 3 Armin Le Grand (collabora) 2025-06-11 11:25:57 UTC
The transparency is a result/feature using the new possibilities from https://gerrit.libreoffice.org/c/core/+/185417. It is hard to evaluate if that is preferred or not, more a question of taste. I did that only for the hovering mode and due to the fact that seeing more information is in principle always better. We would have to ask users or add this as a configurable option - or just ignore that we can do that now and remove it...
Will also take a look at the blur, but that is just for the surrounding lines (not the text, that is always INTENDED to be AntiAliased) display of the DrawShape...
Comment 4 Buovjaga 2025-06-11 11:28:44 UTC
(In reply to Armin Le Grand (allotropia) from comment #3)
> The transparency is a result/feature using the new possibilities from
> https://gerrit.libreoffice.org/c/core/+/185417. It is hard to evaluate if
> that is preferred or not, more a question of taste. I did that only for the
> hovering mode and due to the fact that seeing more information is in
> principle always better. We would have to ask users or add this as a
> configurable option - or just ignore that we can do that now and remove it...

Ok, then let's loop the UX team in.
Comment 5 Heiko Tietze 2025-06-11 12:32:31 UTC
(In reply to Armin Le Grand (allotropia) from comment #3)
> It is hard to evaluate if that is preferred or not...
https://fosstodon.org/@libodesign/114664737185162421 (poll runs 3 days)
Comment 6 Armin Le Grand (collabora) 2025-06-11 14:41:04 UTC
Cool, thanks!

For the blur; Checked that using SYS+ALT+8 and -/0 to zoom in and see better - the outer bounds are on pixels already no blur there. Maybe that is an effect with the transparency (have already switched off locally?)...
Comment 7 Buovjaga 2025-06-11 16:05:46 UTC
As the topic of the shadow came up in the poll, there is a request for soft shadows: bug 138214
Comment 8 Armin Le Grand (collabora) 2025-06-12 12:02:13 UTC
Ah - that could be done by just setting SoftShadow as attribute to the temp object that is used to create that floating comment's geometry - but that's a feature...
Comment 9 Heiko Tietze 2025-06-15 07:24:28 UTC
Poll has ended with
65% Yes, please make it semi-transparent
35% No, keep it opaque
The total number of participants was 17 (out of 952 followers on @libodesign)

=> keep the transparency

I however wonder if we can improve the situation by differentiating between sticky and temporary comments. If a comment is always shown it would be reasonable to get an idea of the content behind. But for a tooltip like popup on mouse hover we could use an opaque background.
Comment 10 Xisco Faulí 2025-06-16 09:02:50 UTC
I just stepped upon this issue in

Version: 25.8.0.0.alpha1+ (X86_64) / LibreOffice Community
Build ID: 04744bbc9be4adca92eaba602b7a65c17f6b8dd7
CPU threads: 8; OS: Linux 6.1; UI render: default; VCL: gtk3
Locale: es-ES (es_ES.UTF-8); UI: en-US
Calc: threaded
Comment 11 Armin Le Grand (collabora) 2025-06-16 09:15:41 UTC
(In reply to Heiko Tietze from comment #9)
> I however wonder if we can improve the situation by differentiating between
> sticky and temporary comments. If a comment is always shown it would be
> reasonable to get an idea of the content behind. But for a tooltip like
> popup on mouse hover we could use an opaque background.

I would do it *exactly* the other way around:

- sticky: The user has decided to see all comments, so actively decides to concentrate on these -> no interest in BG. In that case I would assume that transparency would indeed be distracting and not what the user wants.

- temporary/popup: Only short need to take a look at the comment. Slight transparency can help here for better orientation, e.g. see where else comments are that might be worth to take a look at. If these are covered by popup comment this is just not possible and hinder fast orientation. We can assume something like a 1st research phase for a newly opened document
Comment 12 Buovjaga 2025-06-16 09:21:11 UTC
(In reply to Armin Le Grand (allotropia) from comment #11)
> (In reply to Heiko Tietze from comment #9)
> > I however wonder if we can improve the situation by differentiating between
> > sticky and temporary comments. If a comment is always shown it would be
> > reasonable to get an idea of the content behind. But for a tooltip like
> > popup on mouse hover we could use an opaque background.
> 
> I would do it *exactly* the other way around:
> 
> - sticky: The user has decided to see all comments, so actively decides to
> concentrate on these -> no interest in BG. In that case I would assume that
> transparency would indeed be distracting and not what the user wants.

This is probably faster to render as well, right?
Comment 13 Armin Le Grand (collabora) 2025-06-16 12:04:52 UTC
(In reply to Buovjaga from comment #12)
> This is probably faster to render as well, right?

Hard to say - depends on SDPR and HW support :) But in general: We should NOT argue with rendering speed when thinking about UI and UserExperience. The one is for satisfaction/Joy of the user, the other is a (solvable) technical problem. We should not let us hold back from that from my POV...
Comment 14 Armin Le Grand (collabora) 2025-06-20 08:57:51 UTC
So if no complaints to comment 11 this one is as it should be...? Can I close?
Comment 15 Buovjaga 2025-06-20 09:00:33 UTC
(In reply to Armin Le Grand (allotropia) from comment #14)
> So if no complaints to comment 11 this one is as it should be...? Can I
> close?

I see your comment 6, but can't the blurriness really be fixed?
Comment 16 Armin Le Grand (collabora) 2025-06-20 18:30:13 UTC
Invested: I did quite some changes, but indeed PixelSnap and Hairline *is* active in CairoPixelProcessor2D::processPolygonStrokePrimitive2D as it should be. The hairline is snapped to discrete pixels and drawn as hairline.

I also checked if all this is set in the ViewInformation2D used in OverlayManager::ImpDrawMembers, it is.

I still see that sometimes the left (blue) vertical line for a popup comment is not on a single pixel -> no idea why, have to think about it...
Comment 17 Armin Le Grand (collabora) 2025-07-15 12:20:55 UTC
Taking a 2nd look, I have a suspicion...
Comment 18 Armin Le Grand (collabora) 2025-07-15 14:01:14 UTC
Looks like it's indeed in the CairoSDPR: When using a sub-surface for pre-rendering something (needed for UnifiedTransparence, Transparence and XOR) the sub-surface gets an own temp PrimitiveRenderer with needed adapted ViewTransformation.
Up to now that less than a pixel distance (sub surface *has* of course to be pixel aligned) from the logical bounds seems to cause that in these sub-renderings the PixelSnap does not work. That also explains why it's only happening with using transparency - thus, a really good find in the end :-)

Need to investigate more, but should be doable...
Comment 19 Armin Le Grand (collabora) 2025-07-15 15:51:19 UTC
Fit at https://gerrit.libreoffice.org/c/core/+/187928
Comment 20 Commit Notification 2025-07-16 08:53:41 UTC
Armin Le Grand (collabora) committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/15a5d633fec3c3c62870ab4168a1886796350031

tdf#166734 CairoSDPR: use sub-pixel correct transformation

It will be available in 26.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 21 Buovjaga 2025-07-16 11:41:32 UTC
Thanks, looks fine now. Feel free to close as fixed and let's backport.

Arch Linux 64-bit
Version: 26.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 6566fdd608490e3fe25e7f5cae641cad00e181e5
CPU threads: 8; OS: Linux 6.15; UI render: default; VCL: kf6 (cairo+wayland)
Locale: fi-FI (fi_FI.UTF-8); UI: en-US
Calc: CL threaded
Built on 16 July 2025
Comment 22 Commit Notification 2025-07-16 13:20:16 UTC
Armin Le Grand (collabora) committed a patch related to this issue.
It has been pushed to "libreoffice-25-8":

https://git.libreoffice.org/core/commit/e09e660c74d5905dff5700c1017e481b608c3800

tdf#166734 CairoSDPR: use sub-pixel correct transformation

It will be available in 25.8.0.2.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 23 Armin Le Grand (collabora) 2025-07-16 19:24:19 UTC
> Thanks, looks fine now. Feel free to close as fixed and let's backport.
Where to backport to, I am not so on the current versions, could you help please? Should not make problems technically.
Comment 24 Buovjaga 2025-07-17 05:50:57 UTC
(In reply to Armin Le Grand (collabora) from comment #23)
> > Thanks, looks fine now. Feel free to close as fixed and let's backport.
> Where to backport to, I am not so on the current versions, could you help
> please? Should not make problems technically.

The issue was in 25.8, so I backported it to libreoffice-25-8 branch.
Comment 25 Armin Le Grand (collabora) 2025-07-17 10:54:37 UTC
(In reply to Buovjaga from comment #24)
> The issue was in 25.8, so I backported it to libreoffice-25-8 branch.

Thanks!