maurges / dynamic_workspaces

A kwin script that creates and deletes desktops as you move windows on the last one
BSD 3-Clause "New" or "Revised" License
69 stars 8 forks source link

Bug Report: Dynamic Workspaces Script Fails After Kubuntu 24.04 Update #15

Open JoseEdSouza opened 1 month ago

JoseEdSouza commented 1 month ago

Bug Report: Dynamic Workspaces Script Fails After Kubuntu 24.04 Update

Summary: After updating to Kubuntu 24.04, the dynamic workspaces script that had been running without issues for the past year has stopped working. Running 'kwin_x11 --replace &' to restart KWin results in an error message.

Steps to Reproduce:

  1. Update to Kubuntu 24.04.
  2. Attempt to run the dynamic workspaces script.
  3. Run kwin_x11 --replace & to restart KWin.

Expected Result: The script should run without errors, as it did before the update.

Actual Result: The script fails with the following error message:

kwin_scripting: /home/jose_edsouza/.local/share/kwin/scripts/dynamic_workspaces/contents/code/main.js:95: error: Cannot read property 'index' of undefined

Details:

Additional Information: This script has been functioning correctly for a year prior to the update to Kubuntu 24.04. The error seems to indicate an issue with accessing the 'index' property of an undefined object within the script at line 95.

Steps Taken to Resolve:

Environment:

Request for Help: Any assistance in resolving this issue would be greatly appreciated, especially insights into changes in Kubuntu 24.04 that might affect script compatibility with KWin.

Thank you for your support.

maurges commented 1 month ago

Thanks for the report. Kubuntu still uses plasma 5, so for the time you can manually install the previous version of the script which worked fine.

The real seems to be main.js:257. Now I stopped understanding why it doesn't fail for any other plasma version too: I get the desktop length once, so necessarily desktopIdx will run higher than the real amount of desktops if I delete at least one in this loop. It seems in case only one desktop is to be deleted, this is prevented by loopCounter.

Unfortunately(for multiple reasons) I don't have a linux PC on hand, so testing this fix will take until I get one in a couple of weeks. If a couple of weeks pass and I haven't fixed it, feel free to bump this issue again. :-)

JoseEdSouza commented 1 month ago

Thank you for your quick response and the suggestion to revert to the previous version of the script. I have done so, and it worked simply fine.

I appreciate your willingness to address this problem once you have access to a Linux environment again.

In the meantime, I'll continue using the previous version of the script.

Thank you again for your help and the script that has served me well for the past year.

Best regards, José Souza