https://bugs.kde.org/show_bug.cgi?id=514131

            Bug ID: 514131
           Summary: KWin permanently caches QML files in KWin scripts
    Classification: Plasma
           Product: kwin
      Version First 6.5.3
       Reported In:
          Platform: Bazzite
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: scripting
          Assignee: [email protected]
          Reporter: [email protected]
  Target Milestone: ---

# SUMMARY

When re-loading a KWin `declarativescript` script during a local development
workflow, KWin only loads a cached version of each QML file. After the initial
load, any changes to the contents of the QML files are ignored.


# STEPS TO REPRODUCE

I've created a minimal KWin `declarativescript` example, available at
https://github.com/gplusplus314/kwin-helloworld complete with reproduction
instructions in the `README.md`. Here is a high level reproduction:

1. Create a KWin `declarativescript` with a `main.qml` file that contains a
"Hello World" of sorts.
2. Install, enable, and start the script. You will see "Hello World".
3. Disable and uninstall the script.
4. Change the text in `main.qml` to say "Hello KWin".
5. Disable, uninstall, reinstall, reload the script.


# OBSERVED RESULT

"Hello World"

# EXPECTED RESULT

"Hello KWin"

# SOFTWARE/OS VERSIONS

Linux Kernel: 6.17.7-ba22.fc43.x86_64
KDE Plasma Version:  6.5.4
KDE Frameworks Version: 6.21.0
Qt Version: 6.10.1

# ADDITIONAL INFORMATION

I found a similar issue in another project that uses QML and they've resolved
it by exposing https://doc.qt.io/qt-6/qqmlengine.html#clearComponentCache in
their API. Here is the issue:
https://github.com/JuliaGraphics/QML.jl/issues/195

The only workaround I can find to forcefully invalidate the QML cache in KWin
is to restart KWin altogether, which is very disruptive.

It would be helpful to either perform a `clearComponentCache` upon unload, or
even just expose it via `dbus`, or any other mechanism that would allow us to
have a working development loop/workflow for KWin scripts in QML.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to