Bug 487505 - LSP Client popup empty unless scrolled or selected
Summary: LSP Client popup empty unless scrolled or selected
Status: RESOLVED UPSTREAM
Alias: None
Product: kate
Classification: Applications
Component: general (show other bugs)
Version: 24.02.2
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
: 488013 (view as bug list)
Depends on:
Blocks:
 
Reported: 2024-05-24 23:45 UTC by bbkr
Modified: 2024-07-31 11:14 UTC (History)
3 users (show)

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


Attachments
Recording (3.36 MB, video/webm)
2024-05-24 23:45 UTC, bbkr
Details

Note You need to log in before you can comment on or make changes to this bug.
Description bbkr 2024-05-24 23:45:59 UTC
Created attachment 169796 [details]
Recording

STEPS TO REPRODUCE

1. Enable LSP Client (in my example it was rust-analyzer)
2. Mouse over any piece of code that should show hint

OBSERVED RESULT

Popup is sometimes completly white. Text is visible only after scrolling or selecting.
Please see attached video.

This efect is random(!), in rare cases text is visible right away. Looks like some rendering race condition.

SOFTWARE/OS VERSIONS

Operating System: Arch Linux 
KDE Plasma Version: 6.0.4
KDE Frameworks Version: 6.2.0
Qt Version: 6.7.0
Kernel Version: 6.9.1-arch1-1 (64-bit)
Graphics Platform: Wayland
Processors: 16 × AMD Ryzen 7 6800U with Radeon Graphics
Memory: 27,2 GiB of RAM
Graphics Processor: AMD Radeon Graphics
Comment 1 bbkr 2024-05-25 14:27:18 UTC
Also I've noticed scroll bars are not usable - clicking on one to drag it with a mouse closes LSP Client popup completly.

Maybe not related to this issue, but have you considered adding dedicated window section for LSP hints (like the one for symbols table for example)? Popups are mixed bag of candies. They show in different sizes, sometimes unintentionally covering surrounding code. Having those hints in one place would make work more organized.
Comment 2 bbkr 2024-05-30 09:25:07 UTC
Upgrade to:

Kate 24.05.0
KDE Plasma Version: 6.0.5
KDE Frameworks Version: 6.2.0
Qt Version: 6.7.1
Kernel Version: 6.9.2-arch1-1 (64-bit)

Did not help.
Comment 3 bbkr 2024-05-30 09:33:54 UTC
I found that this issue is caused by
QT_SCALE_FACTOR_ROUNDING_POLICY=RoundPreferFloor

I've started to track back every change I made from vanilla Arch + Plasma installation and at some point I was fixing jagged fonts in Kmail when HiDPI scaling is used by setting this variable globally. When Kate is ran with QT_SCALE_FACTOR_ROUNDING_POLICY=PassThrough the popup texts are always visible. 

I'm leaving this isue open for you to decide if it is a bug (application should work regardles of QT scaling used) or not (only default scaling is supported and tested).
Comment 4 Pavel Urusov 2024-06-04 09:43:01 UTC
Hi, I am also affected by this bug (see https://bugs.kde.org/show_bug.cgi?id=488013), but in my case the QT_SCALE_FACTOR_ROUNDING_POLICY environment variable does not make any difference.

I have found that the issue happens only when scaling is set to 200%, unfortunately with my 23" 4K monitor it is the only setting that is usable for me.
Comment 5 Christoph Cullmann 2024-06-15 15:38:16 UTC
*** Bug 488013 has been marked as a duplicate of this bug. ***
Comment 6 Christoph Cullmann 2024-06-15 17:20:34 UTC
Hmm, works for me with current master and Qt 6.7.1.
I did set both

export QT_SCALE_FACTOR=2

and

tried with and without  

export QT_SCALE_FACTOR_ROUNDING_POLICY=RoundPreferFloor
Comment 7 Pavel Urusov 2024-06-16 20:28:57 UTC
(In reply to Christoph Cullmann from comment #6)
> Hmm, works for me with current master and Qt 6.7.1.
> I did set both
> 
> export QT_SCALE_FACTOR=2
> 
> and
> 
> tried with and without  
> 
> export QT_SCALE_FACTOR_ROUNDING_POLICY=RoundPreferFloor

Christoph, are you using Wayland or X11? I just switched to X11 for testing purposes (I can't really daily drive X11 because I'm using monitors with different scaling factors), and it seems that this issue only triggers under Wayland.
Comment 8 Christoph Cullmann 2024-06-16 22:38:36 UTC
I use and tested it with Wayland.
Comment 9 Pavel Urusov 2024-06-25 09:29:55 UTC
The issue is no longer reproducible in Kate 24.05.1 running under KDE Plasma 6.1.0/Frameworks 6.3.0/Qt 6.7.1
Comment 10 Waqar Ahmed 2024-07-31 11:14:08 UTC
These popups are the last remaining "top level window" in Kate. Top level windows and wayland don't go well. Should have changed it as well along with others.

But seems like this is no longer reproducible, thus for now lets close this issue. Please reopen if you encounter it again.