emvaized / kde-snap-assist

KWin script for KDE Plasma which suggests other window thumbnails on snap
https://store.kde.org/p/1875687
GNU General Public License v3.0
97 stars 6 forks source link

KWin crashes when a JetBrains editor displays a tooltip #36

Closed r-flash closed 1 year ago

r-flash commented 1 year ago

This happens both in WebStorm and CLion. I suppose it would happen in any IDE from JetBrains.

KWin crashes anytime an autocompletion tooltip is shown automatically during typing. This happens consistently and only when KDE Snap Assist is enabled. Both under X11 and Wayland.

This is the stack trace from GDB on X11: kwin_x11.gdb.zip. Unfortunately, my system seems to be missing some debug symbols.

Let me know if I can help with resolving this. I have never written a KWin script but I know JavaScript so if you point me into the right direction, I can add null checks, logs, etc. to the code to help diagnose where this is happening.

emvaized commented 1 year ago

Thanks for your report. I could not confirm crashing when autocompletion tooltip gets shown with Android Studio, which is based on ItelliJ IDEA. However, I experience the crash on closing the app — not sure if it's the same problem that you have.

I just tried adding few more safety checks on the dev branch — will be great if you could download it, install manually (instruction) and let me know if it solves the crash.

Perhaps it could also give you an idea for where to look in the code in case you'd like to continue your own investigation. My assumption was that tooltip windows from IDE in your case were treated as regular windows by the script, and it tried to process them on creation and crashed the KWin, hence I just added new check to not process specialWindows in addListenersToClient() (line 26).

semarainc commented 1 year ago

Hi @r-flash would you like to share your plasma version and your distro info? maybe your problem is related to this issue https://bugs.kde.org/show_bug.cgi?id=459097 https://bugs.kde.org/show_bug.cgi?id=458598

this often happens in Wayland and sometimes in X11, the fix is expected shipped in plasma 5.26

r-flash commented 1 year ago

I'm sorry for taking so long to respond. I tried diagnosing several times but wasn't able to pinpoint the exact circumstances when this happens.

These are my specs:

Operating System: Manjaro Linux
KDE Plasma Version: 5.25.5
KDE Frameworks Version: 5.97.0
Qt Version: 5.15.5
Kernel Version: 5.19.7-1-MANJARO (64-bit)
Graphics Platform: X11
Processors: 12 × Intel® Core™ i5-10400F CPU @ 2.90GHz
Memory: 15,5 GiB of RAM
Graphics Processor: NVIDIA GeForce GTX 1660 SUPER/PCIe/SSE2
Manufacturer: ASUS
emvaized commented 1 year ago

@semarainc Thanks for sharing this. If that's the reason, than I guess I could do nothing about this bug in the script, and we can only wait until the Plasma fix lands for everyone.

I'll keep my dedicated patch though, since even if it doesn't fix this issue, it probably will make the script more stable and reduce the CPU load by not attaching any listeners to special windows. I will include it in the next 1.6.2 release.

emvaized commented 1 year ago

Closing this issue as non related to the script