Skip to content

fix: Garbled text in sidebar and dropdown menus on Linux - #9286

Merged
logseq-cldwalker merged 2 commits into
logseq:masterfrom
cas--:fix/7233/linux-text-sidebar
May 3, 2023
Merged

logseq-cldwalker merged 2 commits into
logseq:masterfrom
cas--:fix/7233/linux-text-sidebar

Conversation

@cas--

@cas-- cas-- commented May 1, 2023 •

Copy link
Copy Markdown
Contributor

Linux users with Intel GPUs have been reporting issues with garbled text
in the sidebar nav and header dropdown menu.

The exact cause is unknown but likely a Electron rendering issue with
Intel GPUs when opacity is set with SVG and text elements.

To workaround the problem we can set the required opacity directly to
the text element.

Added a new is-linux ui class to narrow the workaround to Linux only, not strictly required but thought it would be useful to denote an OS specific workaround.

Fixes #7233

@github-actions github-actions Bot added the fix label May 1, 2023
@CLAassistant

CLAassistant commented May 1, 2023 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@Bad3r

Bad3r commented May 1, 2023 •

Copy link
Copy Markdown
Collaborator

@cas-- Thank you for submitting the PR. Could you please link to the issue in the PR description to kick off GitHub automation for tracking issues/PRs.
#7233

@cas--

cas-- commented May 1, 2023

Copy link
Copy Markdown
Contributor Author

Ah I had linked it in the git commit message but didn't know it needed to be in PR description

@sprocketc sprocketc left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cas-- Big thanks for helping us fix a long standing problem! ❤️

I cannot reproduce the issue or QA the fix, since it requires a particular GPU+drivers combo, but it looks like another user confirmed that it works #7233 (comment)

Applying a nested opacity rule will further decrease the overall opacity of the element. I was wondering if explicitly setting the opacity to 1, also fixes the issue. This is a minor detail, but it would help us understand the problem, and it would produce a consistent result across all platforms,

Added a new is-linux ui class to narrow the workaround to Linux only, not strictly required but thought it would be useful to denote an OS specific workaround.

I am indifferent towards this, but I totally agree that the comment on the CSS changes is useful. If setting the opacity to 1 does not work, I would personally suggest removing the is-linux class to maintain a consistent result. The comment should be enough.

@cas--

cas-- commented May 2, 2023

Copy link
Copy Markdown
Contributor Author

Thanks @sprocketc, I overlooked that nested opacity would decrease existing value of the element, of course barely noticeable when testing!

A quick check and setting opacity to 1 has no effect, likely since a no-op. Setting 0.99 would be close enough for now 🤔

Reading up on opacity on mdn I saw that for values less than 1 it will create a new stack context. From that I tried changing stack context e.g. z-index or clip-path and found that can also mitigate the issue. Not a fix but interesting information to add to issue... Plus it might be any image not just svg...

So I'll update the PR for .99 and keep the is_linux?

@sprocketc

Copy link
Copy Markdown
Collaborator

Thanks for the follow up. If adding the element to a different z-index stack fixes this, simply setting its position to relative might also work. It would also help us pinpoint the cause.

@cas--

cas-- commented May 2, 2023

Copy link
Copy Markdown
Contributor Author

Yes position relative does work too

@sprocketc

Copy link
Copy Markdown
Collaborator

Great! Replacing opacity: .9 with position: relative; would be good enough in my opinion.
Good job on finding the commit that caused this btw.

@cas--
cas-- force-pushed the fix/7233/linux-text-sidebar branch 2 times, most recently from f395080 to 32b1315 Compare May 2, 2023 15:17
@cas--

cas-- commented May 2, 2023

Copy link
Copy Markdown
Contributor Author

I added an extra fix for the graph/repo dropdown (#repo-switch) that also was causing ghosting when mousing over it.

Linux users with Intel GPUs have been reporting issues with garbled
or ghosting text in the sidebar nav and header dropdown menu.

The exact cause is unknown but likely a Electron rendering issue with
Intel GPUs when opacity is set with the icons and text elements.

To workaround the problem we can set an element that will change the
stacking context directly on the problem elements.

Fixes: logseq#7233
@cas--
cas-- force-pushed the fix/7233/linux-text-sidebar branch from 32b1315 to 499a54c Compare May 2, 2023 15:22
@sprocketc
sprocketc self-requested a review May 2, 2023 15:36

@sprocketc sprocketc left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me 🚀

@clarkzjw

clarkzjw commented May 2, 2023

Copy link
Copy Markdown

Thanks for this PR!

I had this issue before, and I tested this PR and it fixes the issue on Intel GPUs for me. 👍

@logseq-cldwalker logseq-cldwalker left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cas-- Hi. Thanks for the fix! 🐛 ⚡ Thanks @clarkzjw for confirming the fix as I didn't have the environment to

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Text in left navigation menu is garbled

6 participants