Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion remwmgui.py
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,22 @@ def main():
)

api.set_window(window)
webview.start()

# On Windows the default WebView2 backend only wires up the js_api bridge
# about half the time: the UI renders but no call ever reaches Python, so
# every button is dead. The Qt backend does it reliably, so prefer it.
gui = None
if sys.platform == 'win32':
try:
import PySide6 # noqa: F401
gui = 'qt'
except ImportError:
pass

# Serve the UI over a local HTTP server: pywebview 5+ does not expose the
# js_api bridge to pages loaded from file://, and fetch() of the config and
# language files is blocked there too.
webview.start(http_server=True, gui=gui)


if __name__ == '__main__':
Expand Down
7 changes: 6 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ Pillow>=10.0.0

# GUI (PyWebview for brainrot HTML UI)
pywebview>=4.0
# Windows: the default WebView2 backend wires up the js_api bridge only about
# half the time, so remwmgui.py runs pywebview on its Qt backend instead.
PySide6; sys_platform == "win32"

# Utilities
loguru
Expand All @@ -23,5 +26,7 @@ psutil
pyyaml

# qt and gtk gui
PyGObject
# PyGObject needs GTK/girepository and Python dev libs, neither of which exist
# in the embedded Python that setup.ps1 installs, so keep it off Windows.
PyGObject; sys_platform == "linux"
qtpy