From f27bb4e7f3f4c1740b599e58bf198886deb5cacb Mon Sep 17 00:00:00 2001 From: Leo Vasanko Date: Wed, 23 Sep 2026 16:56:50 +0000 Subject: [PATCH] Revert "macOS: WKWebView system backend (variant B)" This reverts commit 5b40e306d1ce8ce79ad12840f24f59375304f826. --- mediahive/winmain.py | 4 +++- pyproject.toml | 7 +++++-- scripts/MediaHive.spec | 15 +++++++++++++++ 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/mediahive/winmain.py b/mediahive/winmain.py index c05fb41..9b0d55e 100644 --- a/mediahive/winmain.py +++ b/mediahive/winmain.py @@ -1076,7 +1076,9 @@ def _icon_path() -> str | None: def _webview_start_kwargs() -> dict[str, str]: - """Return platform-specific pywebview startup kwargs (none: default backend).""" + """Return platform-specific pywebview startup kwargs.""" + if sys.platform == "darwin": + return {"gui": "qt"} return {} diff --git a/pyproject.toml b/pyproject.toml index 5b2f876..6744a9a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -51,9 +51,12 @@ parse-torrent-title = { git = "https://github.com/platelminto/parse-torrent-titl [project.optional-dependencies] gui = [ - "pywebview[qt]>=6.2.1; platform_system == 'Linux'", - "pywebview>=6.2.1; platform_system != 'Linux'", + "pywebview[qt]>=6.2.1; platform_system != 'Windows'", + "pywebview>=6.2.1; platform_system == 'Windows'", "velopack>=1.2", + "qtpy>=2.4.1; platform_system == 'Darwin'", + # macOS Qt backend (bundled modern Chromium); PyQt6-WebEngine pulls PyQt6 + "PyQt6-WebEngine>=6.7.0; platform_system == 'Darwin'", "pythonnet>=3.1.0rc0; platform_system == 'Windows' and python_version >= '3.14'", "pyinstaller>=6.0", ] diff --git a/scripts/MediaHive.spec b/scripts/MediaHive.spec index d5db9e3..01bc923 100644 --- a/scripts/MediaHive.spec +++ b/scripts/MediaHive.spec @@ -82,6 +82,21 @@ _hiddenimports = [ "tomli_w", ] +if sys.platform == "darwin": + _hiddenimports.extend( + [ + # pywebview Qt backend selected dynamically via webview.start(gui="qt") + "webview.platforms.qt", + "qtpy", + "PyQt6", + "PyQt6.QtCore", + "PyQt6.QtGui", + "PyQt6.QtWidgets", + "PyQt6.QtWebEngineCore", + "PyQt6.QtWebEngineWidgets", + ] + ) + a = Analysis( [mediahive.winmain.__file__], pathex=[],