gerritdevriese / kzones

KDE KWin Script for snapping windows into zones
https://store.kde.org/p/1909220
GNU General Public License v3.0
238 stars 14 forks source link

TypeError: Cannot read property 'zone' of null // module "Qt5Compat.GraphicalEffects" version 1.0 is not installed #66

Closed scar45 closed 2 months ago

scar45 commented 2 months ago

First off, many thanks for authoring this KWin script @gerritdevriese. On Plasma 5, with my ultrawide monitor, it was a huge workflow enhancer. Since installing on (a fresh/clean install of) Plasma 6, I have had a strange issue where immediately after installing it for the first time, then restoring a backup of my JSON, it worked fine, however after my machine went to sleep, and also subsequent reboots, it will no longer work.

My Specs:

Operating System: Arch Linux 
KDE Plasma Version: 6.0.3
KDE Frameworks Version: 6.0.0
Qt Version: 6.6.3
Kernel Version: 6.8.4-arch1-1 (64-bit)
Graphics Platform: X11

v0.7 of KZones installed from the built-in 'store' ('Get New...')

I was able to get the following output from journalctl, which does show a few issues:

kwin_x11[2183]: file:///home/scar45/.local/share/kwin/scripts/kzones/contents/ui/main.qml:245: TypeError: Cannot read property 'zone' of null

kwin_x11[1137277]: kwin_scripting: Component failed to load:  QList(file:///home/scar45/.local/share/kwin/scripts/kzones/contents/ui/main.qml:507:21: Type Components.Shadow unavailable
                                                                   ^, file:///home/scar45/.local/share/kwin/scripts/kzones/contents/ui/components/Shadow.qml:2:1: module "Qt5Compat.GraphicalEffects" version 1.0 is not installed

Note that the first error of TypeError: Cannot read property 'zone' of null occurred 4 times in quick succession after waking from sleep as mentioned above. If I check the KZones settings, I do see my valid JSON layout there, and all other settings are saved.

The second error of module "Qt5Compat.GraphicalEffects" version 1.0 is not installed occurs any time I enable the script within System Settings --> KWin Scripts.

I found a StackOverflow issue which kind of relates, but that's a blind guess of mine really. I did check to see if I had the qt6-5compat installed, and I do indeed (v6.6.3-1). My JSON structure should also be valid, as it worked for me on Plasma 5 days, and also the first time after installing v0.7 on Plasma 6.

I did have "Enable debug mode" active within the KZones settings, but if there is any other information I can provide, I would be happy to.

Thanks again for such a useful KWin script!

gerritdevriese commented 2 months ago

The only thing I can think of is the version number after the import statements, it already gave some problems during the port for some users, so now I also removed them from the Shadow file.

Are you able to build the main branch to test?

scar45 commented 2 months ago

That worked!

I first removed the 'store' version I had installed, cloned, then built and it installed cleanly. Testing immediately after, it is working as expected.

Many thanks for the commit, and again, the script itself.