endlessm / endless-key-app

Endless Key app for Windows (formerly known as kolibri-app)
https://www.endlessos.org/key
MIT License
2 stars 1 forks source link

Replace Electron with pywebview #161

Closed starnight closed 10 months ago

starnight commented 10 months ago

Endless Key app uses Electron's webview as the frontend. But, it cannot use system's dGPU correctly.

Pywebview is a Python library briding between Python application and native webview from system. On Windows, it invokes Webview2 runtime, which is a loader to load Windows' native webview. This also reduces size of the package, because it does not contain another webview. Besides, using native system's webview gains better system support, for example the dGPU.

Fixes: https://github.com/endlessm/endless-key-app/issues/141

starnight commented 10 months ago

I notice it directs to welcome screen from loading screen every launch time ... Which means have to choose & download pack every launch time. Trying to find out why it happens. So, this PR is in draft state.

starnight commented 10 months ago

I notice it directs to welcome screen from loading screen every launch time ... Which means have to choose & download pack every launch time. Trying to find out why it happens. So, this PR is in draft state.

Ok! Found this needs cookie/session feature.

starnight commented 10 months ago

During the test, I notice pywebview (system's webview) will create cookies' stoarage path in C:\Users<user>\Appdata\Roaming\kolibri-electron\endless-key, not the APPX/MSIX package's mapped virtual path C:\Users<user>\AppData\Local\Packages\EndlessOSFoundation.EndlessKey_xxxooooxxx\LocalCache\Roaming\kolibri-electron\endless-key. I am preparing another commit to fix it.

Pywebview still work as expected! Just try to fix the cookies' storage path.

starnight commented 10 months ago

During the test, I notice pywebview (system's webview) will create cookies' stoarage path in C:\Users<user>\Appdata\Roaming\kolibri-electron\endless-key, not the APPX/MSIX package's mapped virtual path C:\Users<user>\AppData\Local\Packages\EndlessOSFoundation.EndlessKey_xxxooooxxx\LocalCache\Roaming\kolibri-electron\endless-key. I am preparing another commit to fix it.

Pushed commit Fix KOLIBRI_HOME as real path of %APPDATA%\kolibri-electron\endless-key to fix it. This PR is ready for review again!

vanessa-chang commented 10 months ago

Verified Passed in Windows 7.8.3.0