Open zzag opened 2 weeks ago
I have a question. Krohnkite uses windowRemoved(KWin::Window *window) signal. https://github.com/anametologin/krohnkite/blob/3c546f45065d1b47a0ef077446fa04f91f972eaa/src/driver/kwin/kwindriver.ts#L355-L361
Can I use a given window reference inside signal's callback function?
Can I use a given window reference inside signal's callback function?
Yes, but you should not do anything about the window, e.g. resize it or make it fullscreen, etc. The windowRemoved()
signal indicates that the window is already removed.
You can also read various properties of the window, just not change the window state. Also, you should not use the window object after the windowRemoved
signal has been emitted.
https://invent.kde.org/plasma/kwin/-/merge_requests/6424 addresses the kwin crash, but in general, judging by the crash, the window is used some time after the windowRemoved signal has been emitted
We (KWin upstream) have received a substantial number of crash reports from users who use Krohnkite script https://crash-reports.kde.org/organizations/kde/issues/36968
The culprit seems to be that Krohnkite can access window properties after the window has been closed. It's not supported behavior. Ideally, when a window is closed, a script should drop all its window references.