| Summary: | Window may randomly become invisible after activating "Peek at Desktop", disabling windowaperture makes it visible again | ||
|---|---|---|---|
| Product: | [Plasma] kwin | Reporter: | Franciszek Stachura <fbstachura> |
| Component: | effects-various | Assignee: | KWin default assignee <kwin-bugs-null> |
| Status: | CONFIRMED --- | ||
| Severity: | normal | CC: | nate |
| Priority: | NOR | ||
| Version First Reported In: | 6.4.2 | ||
| Target Milestone: | --- | ||
| Platform: | Arch Linux | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
|
Description
Franciszek Stachura
2025-07-10 10:43:16 UTC
Do you see anything in kwin's logs? journalctl --boot -0 --user-unit plasma-kwin_wayland (In reply to Vlad Zahorodnii from comment #1) > Do you see anything in kwin's logs? > > journalctl --boot -0 --user-unit plasma-kwin_wayland Yes, this message appears quite often when holding Meta+D, also around the time the window disappears (but not only then). ``` lip 10 13:07:28 trial kwin_wayland[2422]: "Could not convert argument 0 from undefined to QList<qulonglong>" lip 10 13:07:28 trial kwin_wayland[2422]: "animationEnded@:188" lip 10 13:07:28 trial kwin_wayland[2422]: <Unknown File>:188: TypeError: Passing incompatible arguments to C++ functions from JavaScript is not allowed. ``` This looks like a QJSEngine bug :( https://invent.kde.org/plasma/kwin/-/blob/b8e3426b49350e94ea0233fe6a4e9c73c74a3424/src/plugins/windowaperture/package/contents/code/main.js#L144 set() returns a proper value but `w.offToCornerId` is `undefined` after the assignment. A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/7899 (In reply to Vlad Zahorodnii from comment #3) > This looks like a QJSEngine bug :( > > https://invent.kde.org/plasma/kwin/-/blob/ > b8e3426b49350e94ea0233fe6a4e9c73c74a3424/src/plugins/windowaperture/package/ > contents/code/main.js#L144 set() returns a proper value but > `w.offToCornerId` is `undefined` after the assignment. (I don't know much about KDE internals so I'm not saying it's not a QJSEngine bug, but...) Are you sure? I added some logs where offToCornerId is set and deleted and I get traces like the following: > js: showing, set w.offToCornerId KWin::EffectWindow(0x5626eb88fb80) [73251,73252] > js: animation ended KWin::EffectWindow(0x5626eb88fb80) [73251,73252] > js: animation ended KWin::EffectWindow(0x5626eb88fb80) undefined > "Could not convert argument 0 from undefined to QList<qulonglong>" > "animationEnded@:192" > <Unknown File>:192: TypeError: Passing incompatible arguments to C++ functions from JavaScript is not allowed. Right before the TypeError there always are two consecutive "animation ended", the second always has undefined offToCornerId. "showing, set w.offToCornerId" never shows undefined offToCornerId (but I guess it could become undefined after the function exists...). I only get this message if I hold Meta+D (so I guess things must happen fast). Modified /usr/share/kwin-wayland/effects/windowaperture/contents/code/main.js: https://gist.github.com/fstachura/8af1e74b7698dd14b40fdcda1867711c Yeah I'm pretty sure. That TypeError can occur when both animate() and set() animations finish, which is the linked MR fixes. But the problem is still that w.offToCornerId is undefined sometimes even though set() has returned a valid array object. QJSEngine used to have a similar issue in the past, https://codereview.qt-project.org/c/qt/qtdeclarative/+/376471, but in that case it did delete the wrapper for EffectWindow some time later when collecting garbage, so we saw that w.offToCornerId were valid after the assignment, but when it was time to show windows back, some offToCornerId's were gone. |